Hi everybody, I'm new at this world of arduino, but not so much with the programming one. The thing is that I'm running some tests on the arduino IDE and checking out the examples. When I try to program some scketch with the delay() function or try out the examples (like blink) it stops at the delay function, not the compiler but the board. I'm running all the tests in the proteus simulation program. It runs perfectly untill the delay.
What is happening?
Help please!!!
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
I have the proteus simulator (ISIS). It has the minimal circuitery (crystal, reset bttn, etc) and one simple led. It blinks but aparently it keeps 16 secs on and then 16 off. I didn't realized before because I was just expecting a 1hz blink. What culd be happening?
I think you're right. I've been checking out the source of the clock and I think there's the error. Do you know which of the diferent clock sources is the arduino's one? And if you know exactly the register configuration you will save me completely!!