I just wrote a simple app that that controls pins 12 and 13 in a loop while a pin is low (connected to ground to save having to have a resistor inline). The code goes as follows:
int buttonState = 0;
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
// initialize the pushbutton pin as an input:
pinMode(6, INPUT);
//initialize the buttonPin as output
digitalWrite(6, HIGH);
}
// the loop function runs over and over again forever
void loop() {
buttonState = digitalRead(6);
if (buttonState == HIGH) {
digitalWrite(13, LOW);
digitalWrite(12, LOW);
} else {
for (int i=0; i<8; i++){
digitalWrite(13, HIGH);
delay(50);
digitalWrite(13, LOW);
delay(50);
digitalWrite(12, HIGH);
delay(50);
digitalWrite(12, LOW);
delay(50);
}
delay(1500);
}
}
Now, when I power up the nano, it goes through its sequence then goes silent until either I short the ground to pin 6 or until it decides to short itself I'm guessing based on other posts I have read (internal short in the IC). What I cant figure out is why after some time the short vanishes and the ciruit is HIGH again causing the program to stop. In other words, pins 12 and 13 stop triggering my relays.
Could the NANO be fried? I tried this with pin 7 also.