Updating image do not switch off
Call this to define a timeout period (in seconds) after which the library will automatically power down the Arduino.
Note: this time out period is reset if the user quickly presses the power button, or if your code calls Optional: Call this function to reset the timeout period and start the timeout count from the beginning.
You might use this, for example, to power down the Arduino when battery voltage drops too low.
However, you should consider coding some way to notify the user and give then a change to abort the operation.
However, I would avoid using pin used for the LED in the Blink example (usually pin 13 for most Arduino boards, but it may vary with others, such as the Adafruit Gemma.)Important: as noted in the source code above, you'll need to press and hold the button until the LED lights in order to power up most Arduino systems.
This is due to a startup delay that's coded into the Arduino's boot loader code and that's used to wait a few seconds to see if the Arduino IDE is trying to upload new code.
When a new update has been downloaded and installed, Windows 10 will prompt you to schedule a time for your PC to restart.
A small warning: Microsoft may be scrapping this ultra-convenient feature in the Windows 10 Anniversary Update.
Update, May 15: With the Windows 10 Creators Update, Microsoft has largely addressed the forced updates that often resulted in lost work.
Usually, you'll want to call this function when your code detects input from some user control that indicates that someone is actively using whatever device Auto Power is controlling.
In this way, the device stays powered on as long as someone is using it, much in the way a screensaver works.
See source code above and the notes that follow for more details.
You should not call when your code is in the middle performing some process that should not be interrupted by a possible loss of power, such as writing to EEPROM, or a memory card, etc.