|
1 | 1 | /*
|
2 |
| - Charger Demo |
3 |
| -
|
4 |
| - This sketch demonstrates how to use the PowerManagement library enable low power modes on the Arduino Portenta H7. |
5 |
| - * In the setup() function, it enters standby mode and waits for a wakeup event from the RTC. |
6 |
| - * The loop() functionit is not used in this sketch. |
7 |
| - |
8 |
| - IMPORTANT: Please note that this sketch has to be uploaded to the M4 core too in order to achieve the lowest power consumption. |
9 |
| -
|
10 |
| - Requirements: |
11 |
| - - Arduino Arduino Portenta H7 |
12 |
| - - Arduino IDE |
13 |
| - - PowerManagement library (installable from the Arduino Library Manager) |
14 |
| -
|
15 |
| - Usage: |
16 |
| -
|
17 |
| - 1. Connect a battery to the board. |
18 |
| - |
19 |
| - 2. Upload the Sketch to the M4 core: |
20 |
| - - Open the provided sketch in the Arduino IDE. |
21 |
| - - Select your board type and port from the "Tools" menu. |
22 |
| - - Select the M4 core from the "Tools" menu. |
23 |
| - - Click the "Upload" button to upload the sketch to your board. |
24 |
| -
|
25 |
| - 3. Upload the Sketch to the M7 core: |
26 |
| - - Select the M7 core from the "Tools" menu. |
27 |
| - - Click the "Upload" button to upload the sketch to your board. |
28 |
| -
|
29 |
| - 4. Observer LED behavior: |
30 |
| - - The blue LED will turn on when the board is awake. |
31 |
| - - The blue LED will turn off when the board goes to sleep. |
32 |
| - - The red LED will blink if the board fails to initialize. |
| 2 | + Standby Wake from RTC Demo for Portenta H7 |
| 3 | +
|
| 4 | + This example demonstrates how to wake up the Portenta H7 from standby mode using the included RTC (Real Time Clock). |
| 5 | + The device will go to sleep for 10 second and then stay awake for another 10. When the device is awake you will see the board's blue LED turned on. |
| 6 | + Effectivelly, you will get the same effect as with blink. |
| 7 | +
|
| 8 | + On the Portenta H7 with the peripherals turned off you can expect around 300uA of current consumption in standby mode. |
| 9 | +
|
| 10 | + The example also turns off the peripherals before going to sleep and turns them back on after waking up. |
| 11 | +
|
| 12 | + Usage: |
| 13 | + - Make sure you are running the latest version of the Renesas Core |
| 14 | + - Select the Portenta H7 board from the Tools men |
| 15 | + - Select the Portenta H7 USB port from the Tools menu |
| 16 | + - Upload the code to your Portenta H7 |
| 17 | +
|
| 18 | + Original author: C. Dragomir (http://arduino.cc) |
33 | 19 | */
|
34 | 20 |
|
35 | 21 | #include "Arduino_PowerManagement.h"
|
@@ -74,6 +60,7 @@ void setup() {
|
74 | 60 | fuelgauge.setOperationMode(FuelGaugeOperationMode::shutdown);
|
75 | 61 | delay(10000); // keep the board awake for 10 seconds, so we can se it working
|
76 | 62 |
|
| 63 | + |
77 | 64 | // The LED should go off when the board goes to sleep
|
78 | 65 | board.setAllPeripheralsPower(false);
|
79 | 66 |
|
|
0 commit comments