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.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Libs/PollSwitch/PollSwitch.cpp
- Committer:
- pspatel321
- Date:
- 2015-01-22
- Revision:
- 36:0afc0fc8f86b
- Parent:
- 30:91af74a299e1
File content as of revision 36:0afc0fc8f86b:
#include "PollSwitch.h"
PollSwitch::PollSwitch(DigitalIn *swArr, int numSw){
numSwitches = numSw;
sw = swArr;
}
char PollSwitch::poll(){
char i = 0;
// If a low signal is detected, previous switch is broken
for (i = 0; i < numSwitches; i++) {
if (sw[i].read() == 0) break;
}
if (i >= numSwitches) i = 0;
else i++;
return i;
}
