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.
Revision 2:9164b1d0b53d, committed 2016-03-10
- 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 |
diff -r b1edfc95570c -r 9164b1d0b53d BallastController.cpp
--- 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
diff -r b1edfc95570c -r 9164b1d0b53d BallastController.h
--- 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;
};