Skip to content

Instantly share code, notes, and snippets.

@monpetit
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save monpetit/c96e8114fcd5430044eb to your computer and use it in GitHub Desktop.

Select an option

Save monpetit/c96e8114fcd5430044eb to your computer and use it in GitHub Desktop.
const int reset_pin = 5;
uint32_t count = 10;
void software_reset(void)
{
digitalWrite(reset_pin, LOW);
}
void setup()
{
digitalWrite(reset_pin, HIGH);
delay(200);
pinMode(reset_pin, OUTPUT);
Serial.begin(115200);
delay(100);
Serial.println("START...");
}
void loop()
{
Serial.print("count = ");
Serial.println(count--);
if (count == 0) {
Serial.println("SOFTWARE RESET...");
delay(500);
software_reset();
}
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment