Low Voltage on output

Hey guys.

So ive been using some transistors to control some lights with the arduino. specifically a Traffic light, well ive been messing around with my code and i ran into a weird issue. For some reason when the yellow light flashes the arduino only out puts 0.02 volts. but when the arduino cycles through the lights the yellow goes back to full brightness. I even wired up a separate light on a separate bread board and it did the same thing. when i change the light that is being flashed it goes back to normal. but it doesnt like the yellow light

int red =12;
int yellow =11;
int green = 10;
int blinkTime = 550;
bool eyesStinging=true;

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(12, OUTPUT);
if(eyesStinging) //Only blink if it’s absolutely necessary
blinkyBlinky(12, blinkTime); // 12 is number of blinks, blinkTime is the milliseconds in each state from above: int blinkTime = 500;
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);

}

// the loop function runs over and over again forever
void loop() {
digitalWrite(green, HIGH);
delay(10000);
digitalWrite(green, LOW);
delay(0);

digitalWrite(yellow, HIGH);
delay(4000);
digitalWrite(yellow, LOW);
delay(0);

digitalWrite(red, HIGH);
delay(10000);
digitalWrite(red, LOW);
delay(0);
}
void blinkyBlinky(int repeats, int time)
{
for (int i = 0; i < repeats; i++)
{
digitalWrite(yellow, HIGH);
delay(time);
digitalWrite(yellow, LOW);
delay(time);
}
}

Please show us a schematic.

LED_BUILTIN is 13, not 12.

Please read the instructions regarding how to modify your previous posts to show your code in a useful manner.

It appears "blinkyBlinky()" is used only in setup(), and before you actually define the yellow pin as an OUTPUT.

We see this all the time. Writing an INPUT pin as HIGH sets it to INPUT_PULLUP with a 47k internal pullup - quite a dim glow. :grin:

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile: