Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Committer:
pspatel321
Date:
Thu Nov 13 10:53:10 2014 +0000
Revision:
30:91af74a299e1
Child:
36:0afc0fc8f86b
Parth's edits for the week.; DC-DC completed and fixed, IMD updated, LatchMonitor and Temperature added.  Serial dashboard updated.  File structure changed Everything tested.  Compiles and runs.; Still need to write CAN in/out interface.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pspatel321 30:91af74a299e1 1 #include "PollSwitch.h"
pspatel321 30:91af74a299e1 2
pspatel321 30:91af74a299e1 3 PollSwitch::PollSwitch(LPCDigitalIn *swArr, int numSw){
pspatel321 30:91af74a299e1 4 numSwitches = numSw;
pspatel321 30:91af74a299e1 5 sw = swArr;
pspatel321 30:91af74a299e1 6 }
pspatel321 30:91af74a299e1 7
pspatel321 30:91af74a299e1 8 char PollSwitch::poll(){
pspatel321 30:91af74a299e1 9 char i = 0;
pspatel321 30:91af74a299e1 10
pspatel321 30:91af74a299e1 11 // if a low signal is detected, previous switch is broken
pspatel321 30:91af74a299e1 12 for (i = 0; i < numSwitches; i++) {
pspatel321 30:91af74a299e1 13 if (!sw[i].read()) break;
pspatel321 30:91af74a299e1 14 }
pspatel321 30:91af74a299e1 15 if (i >= numSwitches) i = 0;
pspatel321 30:91af74a299e1 16 return i+1;
pspatel321 30:91af74a299e1 17 }