![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
NHK2017 octopus robot
Dependencies: 2017NHKpin_config mbed FEP ikarashiMDC PID jy901 omni HMC6352 omni_wheel
Fork of KANI2017v2 by
bot/limitSwitch/limitSwitch.cpp
- Committer:
- number_key
- Date:
- 2017-10-25
- Revision:
- 26:7258d5ad0bff
- Parent:
- 25:d199d621ecca
File content as of revision 26:7258d5ad0bff:
#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; }