Octopus!!
Dependencies: 2017NHKpin_config FEP HMC6352 PID QEI R1307 ikarashiMDC omni_wheel
Fork of KANIv3 by
bot/limitSwitch/limitSwitch.cpp
- Committer:
- number_key
- Date:
- 2017-11-11
- Revision:
- 49:69a7235d837a
File content as of revision 49:69a7235d837a:
#include "limitSwitch.h" Limit::Limit(PinName limitSwitch1, PinName limitSwitch2) : frontSwitch(limitSwitch1), backSwitch(limitSwitch2) { frontSwitch.rise(callback(this, &Limit::frontLimit)); backSwitch.rise(callback(this, &Limit::backLimit)); } void Limit::frontLimit() { position = -1; } void Limit::backLimit() { position = 1; } void Limit::resetPosition() { position = 0; } int Limit::getPosition() { return position; }