Python variable names are case-sensitive.
Replace:
import RPi.GPIO as GPIO
with:
import RPi.GPIO as gpio
Frage
But have copied script from another programme, which doesn't give this error. What am I doing wrong?
Thanks for your advice in advance.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import time
import RPi.GPIO as GPIO
#setup pin 10 as an output
gpio.setmode(gpio.BCM)
gpio.setmode(10, gpio.OUT)
#Make an LED flash on and off forever
while True:
gpio.output(10, gpio.HIGH)
time.sleep(1)
gpio.output(10, gpio.LOW)
time.sleep(1)
Lösung
Python variable names are case-sensitive.
Replace:
import RPi.GPIO as GPIO
with:
import RPi.GPIO as gpio