1
BallastController.cpp@2:9164b1d0b53d, 2016-03-10 (annotated)
- Committer:
- sk398
- Date:
- Thu Mar 10 16:23:34 2016 +0000
- Revision:
- 2:9164b1d0b53d
- Parent:
- 0:8380ab528739
Initial working version including output command using state pointer
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sk398 | 0:8380ab528739 | 1 | /* ##################################################################### |
| sk398 | 0:8380ab528739 | 2 | SD20.cpp |
| sk398 | 0:8380ab528739 | 3 | -------- |
| sk398 | 0:8380ab528739 | 4 | |
| sk398 | 0:8380ab528739 | 5 | Surface Ship, Group 5 |
| sk398 | 0:8380ab528739 | 6 | --------------------- |
| sk398 | 0:8380ab528739 | 7 | |
| sk398 | 0:8380ab528739 | 8 | Written by: Steven Kay |
| sk398 | 0:8380ab528739 | 9 | |
| sk398 | 0:8380ab528739 | 10 | Date: February 2016 |
| sk398 | 0:8380ab528739 | 11 | |
| sk398 | 0:8380ab528739 | 12 | Function: This |
| sk398 | 0:8380ab528739 | 13 | |
| sk398 | 0:8380ab528739 | 14 | Version: 1.0 |
| sk398 | 0:8380ab528739 | 15 | |
| sk398 | 0:8380ab528739 | 16 | Version History |
| sk398 | 0:8380ab528739 | 17 | --------------- |
| sk398 | 0:8380ab528739 | 18 | |
| sk398 | 0:8380ab528739 | 19 | 1.1 rgdfgdfgdfggdfgdg |
| sk398 | 0:8380ab528739 | 20 | |
| sk398 | 0:8380ab528739 | 21 | 1.0 gdgddfdddgd |
| sk398 | 0:8380ab528739 | 22 | |
| sk398 | 0:8380ab528739 | 23 | ##################################################################### */ |
| sk398 | 0:8380ab528739 | 24 | |
| sk398 | 0:8380ab528739 | 25 | #include "mbed.h" |
| sk398 | 0:8380ab528739 | 26 | #include "BallastController.h" |
| sk398 | 0:8380ab528739 | 27 | |
| sk398 | 0:8380ab528739 | 28 | |
| sk398 | 0:8380ab528739 | 29 | BallastController::BallastController( PinName S1_D,PinName S1_CLK, |
| sk398 | 0:8380ab528739 | 30 | PinName S2_D,PinName S2_CLK, |
| sk398 | 0:8380ab528739 | 31 | PinName S3_D,PinName S3_CLK, |
| sk398 | 0:8380ab528739 | 32 | PinName S4_D,PinName S4_CLK ) |
| sk398 | 0:8380ab528739 | 33 | { |
| sk398 | 0:8380ab528739 | 34 | Solenoids[0] = new Latch_FET_Driver(S1_D,S1_CLK); |
| sk398 | 0:8380ab528739 | 35 | Solenoids[1] = new Latch_FET_Driver(S2_D,S2_CLK); |
| sk398 | 0:8380ab528739 | 36 | Solenoids[2] = new Latch_FET_Driver(S3_D,S3_CLK); |
| sk398 | 0:8380ab528739 | 37 | Solenoids[3] = new Latch_FET_Driver(S4_D,S4_CLK); |
| sk398 | 0:8380ab528739 | 38 | } |
| sk398 | 0:8380ab528739 | 39 | |
| sk398 | 2:9164b1d0b53d | 40 | void BallastController::outputToSolenoids(bool *states) |
| sk398 | 0:8380ab528739 | 41 | { |
| sk398 | 2:9164b1d0b53d | 42 | |
| sk398 | 2:9164b1d0b53d | 43 | for(int a = 0; a < 4; a++) |
| sk398 | 2:9164b1d0b53d | 44 | { |
| sk398 | 2:9164b1d0b53d | 45 | BallastController::Solenoids[a] -> changeOutputState(*(states+a)); |
| sk398 | 2:9164b1d0b53d | 46 | } |
| sk398 | 0:8380ab528739 | 47 | |
| sk398 | 0:8380ab528739 | 48 | } |
| sk398 | 0:8380ab528739 | 49 | |
| sk398 | 0:8380ab528739 | 50 |