Out of curiosity, I am using this code in Arduino Uno
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
digitalWrite(13, LOW);
}
Uploaded in original Arduino Uno, keeps my led in ON State,
and I did upload the same in one of the Arduino Uno clone board, keeps my led in OFF state, there is no sign of led glow in clone board.
What might be the difference? one board keeps glowing the led, and one board keeps the led in off condition(onboard led).
Will there be any difference in hardware setup for this? Need to know the exact reason.
How fast can you blink? Try:
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(500);
}
and see if it makes a difference.
Yeah fine, I knew it blinks,
but If I dont give a hard delay, one board is glowing continuously and one is not, why is the difference?
You missed my point. You are turning the LED on and off using a clock that's running at 16Mhz. Assuming 50% overhead for the code, can your eyes detect something that's turning off and on 8 million times a second? If you can blink your eyes at that speed and are in sync with the code, you might be able to tell the difference. Your persistence of vision cannot see it blink at those speeds. Adding the delay slows it to a point where you can tell the difference.
An official Arduino UNO R3 uses an op-amp to buffer Pin 13 so that the LED does not act as a pull-down when you use that pin for input. Perhaps the clone uses no op-amp or uses one with different specifications.
econjack:
You are turning the LED on and off using a clock that's running at 16Mhz.
Unlikely. The unity gain bandwidth of the LMV358 is 1 Mhz. So the output probably ends up mostly at a DC level somewhere between 0 and 5V. Because the LEDs may have different Vf, and the opamps may be a different type, the voltage is different and thus may or may not illuminate the LED.
Scope it.
@John, aarg: I did take some electronic liberties trying to make a point...sorry 'bout that.
econjack:
@John, aarg: I did take some electronic liberties trying to make a point...sorry 'bout that.
Nah. All in the name of science. 