Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support mbed
Fork of PowerControl by
main.cpp
00001 #include "mbed.h" 00002 #include "PowerControl/PowerControl.h" 00003 #include "PowerControl/EthernetPowerControl.h" 00004 #include "MDM.h" 00005 #include "GPS.h" 00006 00007 DigitalOut led(LED); 00008 void hello() { 00009 led = !led; 00010 } 00011 00012 int main() { 00013 printf("Starting\r\n"); 00014 wait(5); 00015 printf("Modem on\r\n"); 00016 MDMSerial mdm; 00017 wait(5); 00018 printf("GPS on\r\n"); 00019 GPSI2C gps; 00020 wait(5); 00021 printf("PHY off\r\n"); 00022 PHY_PowerDown(); 00023 wait(5); 00024 printf("Modem off\r\n"); 00025 mdm.powerOff(); 00026 wait(5); 00027 printf("GPS off\r\n"); 00028 gps.powerOff(); 00029 printf("Sleeping\r\n"); 00030 Timeout t; 00031 t.attach(&hello, 5.0f); 00032 Sleep(); 00033 printf("Woke up\r\n"); 00034 while (true); 00035 }
Generated on Wed Jul 13 2022 03:23:35 by
1.7.2
