1

Files at this revision

API Documentation at this revision

Comitter:
sk398
Date:
Thu Mar 10 16:23:34 2016 +0000
Parent:
1:b1edfc95570c
Commit message:
Initial working version including output command using state pointer

Changed in this revision

BallastController.cpp Show annotated file Show diff for this revision Revisions of this file
BallastController.h Show annotated file Show diff for this revision Revisions of this file
--- a/BallastController.cpp	Sat Mar 05 01:54:26 2016 +0000
+++ b/BallastController.cpp	Thu Mar 10 16:23:34 2016 +0000
@@ -37,22 +37,14 @@
     Solenoids[3] = new Latch_FET_Driver(S4_D,S4_CLK);  
 }
 
-void BallastController::Test()
+void BallastController::outputToSolenoids(bool *states)
 {
-    BallastController::Solenoids[0] -> changeOutputState(1);
-    BallastController::Solenoids[1] -> changeOutputState(1);
+   
+    for(int a = 0; a < 4; a++)
+    {
+        BallastController::Solenoids[a] -> changeOutputState(*(states+a));
+    }
     
-    //for(int a = 0; a < 4; a++)
-//    {
-//        BallastController::Solenoids[a] -> changeOutputState(1);
-//    }
-//    
-//    wait(2);
-//    
-//    for(int a = 0; a < 4; a++)
-//    {
-//        BallastController::Solenoids[a] -> changeOutputState(0);
-//    }   
 }
     
     
\ No newline at end of file
--- a/BallastController.h	Sat Mar 05 01:54:26 2016 +0000
+++ b/BallastController.h	Thu Mar 10 16:23:34 2016 +0000
@@ -38,15 +38,14 @@
                     PinName S3_D,PinName S3_CLK, 
                     PinName S4_D,PinName S4_CLK     );
                     
-void Test();
+void outputToSolenoids(bool *states);
+
 private:
 
+
 protected:
-
+// Array of Latch_FET_Driver objects - each index is a solenoid valve object
 Latch_FET_Driver *Solenoids[4];
-//Latch_FET_Driver *Solenoid2;
-//Latch_FET_Driver *Solenoid3;
-//Latch_FET_Driver *Solenoid4;
 
 };