Steven Kay / BallastController
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BallastController.cpp Source File

BallastController.cpp

00001 /* #####################################################################
00002                                SD20.cpp
00003                                --------
00004                 
00005                           Surface Ship, Group 5
00006                           ---------------------
00007  
00008  Written by:        Steven Kay
00009  
00010  Date:              February 2016
00011  
00012  Function:          This 
00013  
00014  Version:           1.0
00015  
00016  Version History
00017  ---------------
00018  
00019  1.1                rgdfgdfgdfggdfgdg
00020  
00021  1.0                gdgddfdddgd
00022     
00023  ##################################################################### */
00024 
00025 #include "mbed.h"
00026 #include "BallastController.h"
00027 
00028 
00029 BallastController::BallastController(   PinName S1_D,PinName S1_CLK,
00030                                         PinName S2_D,PinName S2_CLK, 
00031                                         PinName S3_D,PinName S3_CLK, 
00032                                         PinName S4_D,PinName S4_CLK     )
00033 {
00034     Solenoids[0] = new Latch_FET_Driver(S1_D,S1_CLK);
00035     Solenoids[1] = new Latch_FET_Driver(S2_D,S2_CLK);  
00036     Solenoids[2] = new Latch_FET_Driver(S3_D,S3_CLK);  
00037     Solenoids[3] = new Latch_FET_Driver(S4_D,S4_CLK);  
00038 }
00039 
00040 void BallastController::outputToSolenoids(bool *states)
00041 {
00042    
00043     for(int a = 0; a < 4; a++)
00044     {
00045         BallastController::Solenoids[a] -> changeOutputState(*(states+a));
00046     }
00047     
00048 }
00049     
00050