Project 4 color lamp

EDIT: the breadboard was faulty, the + column didn’t transmit voltage all the way down

Hey, what am I doing wrong? I keep getting 0 for all sensors using the example code given in the IDE. So it must be on the hardware’s end.
When I unplug the analog input, the led flicker in the correspondant light. So red for A0, green for A1 and blue for A2 but as soon as I plug it it goes blank.
Here is my setup


Try inverting the photo transistors

Tried it to no avail :confused:

[quote="dandaremon, post:1, topic:1418438"]
red for A0, green for A1 and blue for A2
[/quote]

Do you set the I/O direction of these with pinMode(pin, OUTPUT);?

Oops.. sorry.. photoxstr, not LED

Sometimes these (blue) gaps in the breadboard allow for a different circuit between the gaps and need a jumper over the gaps (both power and ground). Check for continuity over (blue) gaps.

This (green) jumper looks like a ready-made, gap, jumper.

Assuming the program is Ok, let’s debug the hardware.

Try connecting jumper cables as indicated.

If you bypass a transistor, the corresponding analog input should go to 5V and the sketch should light the corresponding LED.


If you connect an LED resistor directly to 5V it should light regardless of the Arduino sketch. Try this first

I don’t see anything connected to line 9

recheck all wiring

Are you connecting the photo transistors with 560 ohms resistors?

That is too low. The instructions call for 10K ohm, which should work.

Wow that was it, the gap made the circuit open. It wasn’t mentionned on the book so I thought it would travel all the way through the + column. Thank you !

Thank you for your answers, it was the fretboard which was not connected all the way through the « + » column on the right and I needed to add gap bridges even though the book weren’t mentioning them.

I’m glad the issue was solved.

It’s weird, though, because these gaps should be clearly marked as in the picture below.

On the back, under the sticky-foam pad, you might see where jumper clips might have fallen out.