Local library

Dependencies:   WakeUp PinDetect

Dependents:   Inductive_Sensor Inductive_Sensor_Jasper Inductive_Sensor_3

Revision:
5:c2468a69aacb
Parent:
4:9c3c8eb56a2b
Child:
6:0e7c0ad0508b
--- a/Bob.cpp	Wed Mar 30 12:00:43 2016 +0000
+++ b/Bob.cpp	Tue Apr 12 14:39:08 2016 +0000
@@ -14,11 +14,10 @@
 #include "WakeUp.h"
 
 
-Bob::Bob(PinName redled, PinName greenled, PinName sd_enable, PinName sd_present, PinName battery, PinName V_Det) : _red(redled), _green(greenled), _sd_enable(sd_enable)
+Bob::Bob(PinName led, PinName sd_enable, PinName sd_present, PinName battery, PinName V_Det) : _led(led), _sd_enable(sd_enable)
 {
-    _red = 0;
-    _green = 0;    
-    
+    _led = 0;
+
     _sd_enable = 1;    
 
     _sd_card_detect = new DigitalIn( sd_present ); 
@@ -65,34 +64,15 @@
 
 void Bob::flash( int n )
 {
-    _red = 0;
-    _green = 0;
+    _led = 0;
     for(int i=0; i<n*2; i++){
-        _red = 1-_red; _green = 1-_green; wait(0.2);
+        _led = 1-_led; 
+        wait(0.2);
     }
 }
 
-void Bob::flash_red( int n )
-{
-    _red = 0;
-    for(int i=0; i<n*2; i++){
-        _red = 1-_red; wait(0.2);
-    }
-}
-
-void Bob::flash_green( int n )
-{
-    _green = 0;
-    for(int i=0; i<n*2; i++){
-        _green = 1-_green; wait(0.2);
-    }
-}
-
-void Bob::red(void)   { _red   = 1; }
-void Bob::green(void) { _green = 1; }
-
-void Bob::redoff(void)   { _red   = 0; }
-void Bob::greenoff(void) { _green = 0; }
+void Bob::ledon(void)   { _led   = 1; }
+void Bob::ledoff(void)  { _led   = 0; }
 
 
 
@@ -100,3 +80,4 @@
 
 
 
+