1

I'm losely following a traffic light tutorial where the following diagram has been provided:breadboard setup

I've followed the diagram, only deviating from the tutorial to use RPi.GPIO in GPIO.BOARD mode.. I had no problem getting the first 3 lights on/off/flashing etc.

I added two more LEDs, using board pin numbers 15 & 16, but can't get them to come on.. I have reduced the code for them all to just:

RED_LED = 11
YELLOW_LED = 12
GREEN_LED = 13
STOP_LIGHT = 15
GO_LIGHT = 16
GPIO.setup(RED_LED, GPIO.OUT, initial=GPIO.HIGH)
GPIO.setup(YELLOW_LED, GPIO.OUT, initial=GPIO.HIGH)
GPIO.setup(GREEN_LED, GPIO.OUT, initial=GPIO.HIGH)
GPIO.setup(STOP_LIGHT, GPIO.OUT, initial=GPIO.HIGH)
GPIO.setup(GO_LIGHT, GPIO.OUT, initial=GPIO.HIGH)

The first 3 lights are working fine, the last two aren't at all. I'm obviously a beginner so perhaps i'm missing something? I've got a model B pi, revision 2 board. I'm also using 180Ohm resistors for each cheap 5mm LED since that was the closest I had.

  • 1
    Looks fine to me. Try swapping the wires from GPIO pin 13 and 15. See if now the other LED doesn't light up. Otherwise try using two other pins (18,19,21,22,23,24 or 26) – Gerben Aug 13 '13 at 16:39
2

You may have already checked, but make sure you have your LEDs the right way round. Short wire = negative, or if you've trimmed the wire to be the same length, there's also a flat edge to the LED on the negative side.

Next thing, be sure you have connected the jumpers to the right connectors. I've wasted time looking for software errors when I actually just missed the breadboard connector by one row. You could try swapping, say your connectors for pins 13 and 16 to make sure the On/Off parts of your circuit are wired properly.

  • Turned out my breadboard was just a bit of a dud with some holes in the bottom right corner not creating a circuit properly. Is that common? Thanks for taking a look and gave answer for useful tips. – Holly Aug 23 '13 at 13:27

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.