Go Down

Topic: Voltage issue (Read 433 times) previous topic - next topic

fmatray

Hello,
I'm using an arduino YUN with a grove shield and a blue led on PIN 2. Something very easy.

I tried several ways to power the arduino YUN, using the micro USB:
- USB of 2 different computers
- 2 different 5V power supplies : 1A and 2A

This is my code :
Code: [Select]

void setup() {
 digitalWrite(2, HIGH);
}

void loop() {
}



I get the same result :
- The blue led and the shield power led randomly blinks like the the voltage falls down
- sometimes, the sketch restarts

I want to drive led strips but I can't if the voltage is not stable.

Do you have any idea ?
Thanks a lots

Best regards
Frédéric

ShapeShifter

Set the pin as an output.

Code: [Select]

void setup() {
 pinMode(2, OUTPUT);
 digitalWrite(2, HIGH);
}

void loop() {
}


If you don't set the pin as an output, it is assumed to be an input. Calling digitalWrite() to set an input high results in turning on the internal pullup resistor. This will allow some current to flow to the LED, but not nearly enough to properly light it up.

Go Up