Hi my first post. just trying to make a simple code for my Leonardo.
I'm trying the read button pushs for digital pin 0,1,2,3,4 and have them read back from the serial monitor.
I have the current resistor installed on the switches and set to pull down.
Now I cannot even upload a blinky sketch to the leonardo after I have uploaded my code it was working with blinky and a number of test sketches before I sent my death code.
what have I done? this is second leonardo that this has happened to.
Is it possible to do a complete reset of the board? without having to get another?
This is the code I uploaded
int nbts = 5;
int startpin = 0;
int bts[5];
boolean bgts [5];
void setup() {
Serial.begin(9600);
for (int i = 0; i, nbts; i++)bts = i + startpin ;
_ for (int i = 0; i, nbts; i++) bgts = false;_
}
void loop() {
* // put your main code here, to run repeatedly:*
* for (int i = 0; i < nbts; i++) {*
_ if (!bgts*) {
if (digitalRead( bts == LOW )) {
Serial.print("bt:" + String(i) + ":");
Serial.println(1);
bgts = true;
}
}
else {
if (digitalRead (bgts == HIGH )) {
Serial.print("bt:" + String(i) + ":");
Serial.println(0);
bgts = false;
}
}
}
delay(100);
}*_