I am testing my pi for the first time and i cant able to run the first program to light the led.
below is my code id from raspberry cookbook
import Rpi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCD)
GPIO.setup(18,GPIO.OUT)
while(True):
GPIO.output(18, True)
time.sleep(1)
GPIO.output(18,False)
time.sleep(1)
when i run the script sudo python led.py it shows no error but the led has no output. I tried connecting a 360ohms between pin 18 and led. also tried connecting 540Ohms between pin 18 and led but no result.
Can anyone suggest how to debug the problem
while(True):properly indented? Make sure there is consistent indenting (whitespace) after each line you want repeated