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.
Diff: main.cpp
- Revision:
 - 0:f65d77a396a9
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Dec 03 09:10:57 2014 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+#include "rtos.h"
+
+#define ACS D0
+#define TX D3
+#define PAYLOAD D4
+
+BusOut MODE(ACS,TX,PAYLOAD);
+Serial pc(USBTX,USBRX);
+
+
+int flag;
+
+void POWER (void const *args)
+{
+    while(1)
+    {
+    //Thread :: signal_wait(0x2);  
+    printf("Entered Power Management \n"); 
+    printf("Entering mode %d \n", flag);
+    switch (flag)
+    {
+        case 1: MODE = 7;
+        break;
+        case 2: MODE = 6;
+        break;
+        case 3: MODE = 5;
+        break;
+        case 4: MODE = 4;
+        break;
+        case 5: MODE = 2;
+        break;
+        case 6: MODE = 0;
+        break;
+        case 7: MODE = 0;
+        break;
+    }
+    }
+}
+        
+        
+int main()
+{
+    Thread p(POWER, (void *) "power_manage");
+    while(1)
+     {
+     flag = pc.getc();    
+     //Thread :: wait(10000);
+     }
+}
+     
\ No newline at end of file