why simple led python program not working
Question: 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


Answer: You should probably (and I don't know if either main stack or the EE-centric
or the RPi spinoffs has a good way to do this inline) include some sort of
diagram showing which pins you're connecting. At a minimum, you need to do
GPIO 18 to LED to GND, and as LED is Light Emitting Diode or something to that
effect, you need to make sure your LED is pointing in the correct direction.
I'd suggest as a way to debug this partially, take python out of the loop and
just configure the LED to be always on by writing a 1 to the appropiate
/sys/blah/path. Also, <http://elinux.org/RPi_Low-level_peripherals#sysfs>
(which has the path you need) points out... GPIO 24 is wired to P1_18 so you
might want to double check that the pin you think is 18 is called 18 on both
sides of the system.

