Sleep Mode
The Sleep Mode enables the XBee module to enter into a low-power consumption state when they are not in use. The sleep modes are enabled with the setSleepMode() function. The available input values are:
0: Normal mode. In this mode the node will not sleep. 1: Asynchronous Pin Sleep Mode. The module can enter a low-power consumption state according to the value of the sleep pin.
Example of use:
1
{
2
xbee900HP.setSleepMode(0); // Set Normal Mode
3
xbee900HP.setSleepMode(1); // Enable Sleep Mode
4
xbee900HP.getSleepMode(); // Get the Sleep Mode used
5
}
Copied!
Related variables:
xbee900HP.sleepMode → stores the sleep mode in a module
If the Sleep Mode is set to 1, the pin sleep allows the module to sleep and wake. When the pin sleep is asserted (put to \'high\'), the module will finish any transmit or receive operations and enter a low-power state. The module will wake from the low-power state when the pin sleep is de-asserted (\'low\'). For this purpose, the functions sleep() and wake() are defined.
Example of use:
1
{
2
xbee900HP.sleep();
3
delay(5000);
4
xbee900HP.wake();
5
}
Copied!
Sleep mode example:
Last modified 1yr ago
Copy link