0

I want to blink an LED while displaying its count on I2C 16x2 LCD display. However the LED is never becoming lit nor is it glowing at all.

I used https://www.adafruit.com/product/1115 which uses i2c . I connected LED with 270ohm resister between Pin-11(GPIO-17) and Pin-6(GND)

I am using the following code to blink LED but the LED doesn't blink at all!

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD) ## Use board pin numbering
GPIO.setup(11, GPIO.OUT) ## Setup GPIO Pin 7 to OUT
GPIO.output(11,True) 

Do I have to use I2C address instead of GPIO.setmode(GPIO.BOARD)?

Note: LED is not faulty nor is the LCD, I tested both by removing one by one for clear picture !image of LCD display with LED

2

The code looks fine.

The only other thing to go wrong is connecting the LED the wrong way around. Could you confirm that the LED cathode (normally shorter lead and flat spot) is connected to ground.

http://boysdad.com/wp-content/uploads/2012/12/LEDlabel.png

  • you are absolutely right Sir, I had soldered LED a wrong side around; a silly mistake wasted a Day:) – user17795 Jul 3 '14 at 15:54
  • That's life. No harm done. – joan Jul 3 '14 at 15:58

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.