1

Committer:
sk398
Date:
Sat Mar 05 01:50:19 2016 +0000
Revision:
0:8380ab528739
Child:
2:9164b1d0b53d
Controller based on the Latch_FET_Driver class, shall be used to control the operation of the robot's ballast tanks and provide timing functions to accurately control air flow.

Who changed what in which revision?

UserRevisionLine numberNew 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 0:8380ab528739 40 void BallastController::Test()
sk398 0:8380ab528739 41 {
sk398 0:8380ab528739 42 BallastController::Solenoids[0] -> changeOutputState(1);
sk398 0:8380ab528739 43 BallastController::Solenoids[1] -> changeOutputState(1);
sk398 0:8380ab528739 44
sk398 0:8380ab528739 45 //for(int a = 0; a < 4; a++)
sk398 0:8380ab528739 46 // {
sk398 0:8380ab528739 47 // BallastController::Solenoids[a] -> changeOutputState(1);
sk398 0:8380ab528739 48 // }
sk398 0:8380ab528739 49 //
sk398 0:8380ab528739 50 // wait(2);
sk398 0:8380ab528739 51 //
sk398 0:8380ab528739 52 // for(int a = 0; a < 4; a++)
sk398 0:8380ab528739 53 // {
sk398 0:8380ab528739 54 // BallastController::Solenoids[a] -> changeOutputState(0);
sk398 0:8380ab528739 55 // }
sk398 0:8380ab528739 56 }
sk398 0:8380ab528739 57
sk398 0:8380ab528739 58