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.
Input/Switch/Switch.cpp
- Committer:
- kishibekairohan
- Date:
- 2019-02-23
- Revision:
- 10:a81546661fb5
- Parent:
- 9:49e851ad441e
File content as of revision 10:a81546661fb5:
#include "Switch.h"
#include <stdint.h>
DigitalIn limitSw[] = {
DigitalIn(LIMITSW0_PIN),
DigitalIn(LIMITSW1_PIN),
DigitalIn(LIMITSW2_PIN),
DigitalIn(LIMITSW3_PIN),
};
namespace SWITCH
{
void Switch::Initialize(void) {
for(uint8_t i = 0; i < MOUNTING_LIMITSW_NUM; i++) limitSw[i].mode(PullUp);
}
bool Switch::checkPushed(int mySwitch) {
return limitSw[mySwitch] ? false : true;
}
}