
MCUSR register is set, and then clear it later. Here is some example code you could put in your
setup
function
for detecting brown-out resets:
pinMode(13, OUTPUT);
if (MCUSR & (1 << BORF))
{
// A brownout reset occurred. Blink the LED
// quickly for 2 seconds.
for(uint8_t i = 0; i < 10; i++)
{
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
}
}
MCUSR = 0;
Pololu Zumo 32U4 Robot User’s Guide
© 2001–2015 Pololu Corporation
8. The A-Star 32U4 Bootloader
Page 72 of 76