Local library

Dependencies:   WakeUp PinDetect

Dependents:   Inductive_Sensor Inductive_Sensor_Jasper Inductive_Sensor_3

Files at this revision

API Documentation at this revision

Comitter:
bobgiesberts
Date:
Tue Jan 05 11:03:48 2016 +0000
Parent:
0:17943815800f
Child:
2:681ecede6dcb
Commit message:
Added sleep and wakeup functions

Changed in this revision

Bob.cpp Show annotated file Show diff for this revision Revisions of this file
Bob.h Show annotated file Show diff for this revision Revisions of this file
--- a/Bob.cpp	Fri Dec 18 15:49:34 2015 +0000
+++ b/Bob.cpp	Tue Jan 05 11:03:48 2016 +0000
@@ -26,7 +26,7 @@
 {
     // Check if any card is present
     if(_sdP->read() != 1) {
-        flash_green(2);
+        _green = 0;
         return 1;
     }else{
         green();
@@ -34,6 +34,10 @@
     }
 }
 
+void Bob::sleep(void)  { _sdE = 0; }
+void Bob::wakeup(void) { _sdE = 1; wait(0.1); }
+
+
 void Bob::flash( int n )
 {
     _red = 0;
@@ -59,6 +63,6 @@
     }
 }
 
-void Bob::red(void)   { _red   = 1; wait(0.2); }
-void Bob::green(void) { _green = 1; wait(0.2); }
+void Bob::red(void)   { _red   = 1; }
+void Bob::green(void) { _green = 1; }
 
--- a/Bob.h	Fri Dec 18 15:49:34 2015 +0000
+++ b/Bob.h	Tue Jan 05 11:03:48 2016 +0000
@@ -18,6 +18,8 @@
         Bob(PinName redled, PinName greenled, PinName sd_enable, PinName sd_present);
     
         bool checkSD(void);
+        void sleep(void);
+        void wakeup(void);
         void flash(int n);
         void flash_red(int n);
         void flash_green(int n);