Dear all,
I am new to Arduino and I have two doubts, please.
-
How can I re-run an already uploaded code in my Arduino Duemilenove without having to push the reset button on the board? In other words, can I reset my Arduino from my Desktop? In case it is possible, I would greatly appreciate if you can please include that portion of code in the example code I attached below.
In case it is not possible, can I "create" another "reset button" outside the Arduino board (e.g. in a protoboard) to run again my already uploaded program? -
(This question is more curiosity than necessity) How can I access the registers of my Arduino? For example, In the code below, once I have uploaded it, I would like to just change the second entry in the "npulse" array without having to re-upload the whole code in my Arduino.
Thanks so much in advance for your time,
carlo
Example code.
//
int ledPin = 2;
int npulses[3] = {5000,10000,15000};
int counterpos = 0;
int counterpulse = 0;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop()
{
delay(3000);
while (counterpos < 3){
while (counterpulse < npulses[counterpos]){
digitalWrite(ledPin, HIGH);
delayMicroseconds(100);
digitalWrite(ledPin, LOW);
delayMicroseconds(100);
counterpulse=counterpulse+1;
}
delay(5000);
counterpos=counterpos+1;
counterpulse=0;
}
}
//