0

I recently purchased a Raspberry Pi 2 and I am trying to run a simple a simple Blink program but getting this error:

name error 'BCM' is not defined

This is my script

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO,BCM)
GPIO.setwarnings(False)

led = 7

while True:
    GPIO.output(led,1)
    time.sleep(2)
    GPIO.output(led,0)
  • 1
    Hello and welcome. Please be so kind to share your program/script you're running. (Note that you can always edit your own question to include that information, no need to go through comments.) – Ghanima Feb 19 '16 at 7:33
  • sorry i paste code in comment – Mangesh Shelke Feb 19 '16 at 7:36
  • i am new here !!! – Mangesh Shelke Feb 19 '16 at 7:37
  • Not a problem, I edited the question for you. You are new to the site, we're here to help you along. Take the tour and visit the helpcenter to see how things work here. – Ghanima Feb 19 '16 at 7:38
6

It's GPIO.BCM you want. Dot rather than comma.

GPIO.setmode(GPIO.BCM)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.