Miya Miyagawa
/
Orewotaosita
If you wont to knock me down, look this file...
Diff: Input/Switch/Switch.cpp
- Revision:
- 0:4df75b08b14a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Input/Switch/Switch.cpp Fri May 03 11:47:27 2019 +0000 @@ -0,0 +1,20 @@ +#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 mySwitch ? false : true; + } +}