문제

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)
도움이 되었습니까?

해결책

Python variable names are case-sensitive.

Replace:

import RPi.GPIO as GPIO

with:

import RPi.GPIO as gpio
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top