4180 lab 1

Dependencies:   mbed MCP23S17 PinDetect USBDevice

Revision:
12:cc5bda248946
Parent:
11:2cfdab516b21
--- a/powermanagement_ec.h	Tue Jan 21 21:06:20 2020 +0000
+++ b/powermanagement_ec.h	Wed Jan 22 13:08:48 2020 +0000
@@ -13,6 +13,12 @@
  
 DigitalOut myled(p26);
 DigitalIn pb(p22);
+
+Ticker blinker;
+
+void blink() {
+    myled = !pb;
+}
  
 int run_powermanagementEC() {
     int result;
@@ -41,9 +47,8 @@
 // Sleep halts and waits for an interrupt instead of executing instructions
 // power is saved by not constantly fetching and decoding instructions
 // Exact power level reduction depends on the amount of time spent in Sleep mode
-//    blinker.attach(&blink, 0.0625);
+    blinker.attach(&blink, 0.0625);
     while (1) {
-//        Sleep();
-        myled = !pb;
+        Sleep();
     }
 }
\ No newline at end of file