Question

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)
Was it helpful?

Solution

Python variable names are case-sensitive.

Replace:

import RPi.GPIO as GPIO

with:

import RPi.GPIO as gpio
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top