Octopus!!
Dependencies: 2017NHKpin_config FEP HMC6352 PID QEI R1307 ikarashiMDC omni_wheel
Fork of KANIv3 by
bot/limitSwitch/limitSwitch.h@49:69a7235d837a, 2017-11-11 (annotated)
- Committer:
- number_key
- Date:
- Sat Nov 11 17:40:10 2017 +0900
- Revision:
- 49:69a7235d837a
save
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
number_key |
49:69a7235d837a | 1 | #ifndef LIMITSWITCH_H |
number_key |
49:69a7235d837a | 2 | #define LIMITSWITCH_H |
number_key |
49:69a7235d837a | 3 | |
number_key |
49:69a7235d837a | 4 | #include "mbed.h" |
number_key |
49:69a7235d837a | 5 | #include "pin_config.h" |
number_key |
49:69a7235d837a | 6 | |
number_key |
49:69a7235d837a | 7 | |
number_key |
49:69a7235d837a | 8 | |
number_key |
49:69a7235d837a | 9 | class Limit { |
number_key |
49:69a7235d837a | 10 | public : |
number_key |
49:69a7235d837a | 11 | |
number_key |
49:69a7235d837a | 12 | Limit(PinName limitSwitch1, PinName limitSwitch2); |
number_key |
49:69a7235d837a | 13 | |
number_key |
49:69a7235d837a | 14 | |
number_key |
49:69a7235d837a | 15 | void frontLimit(); |
number_key |
49:69a7235d837a | 16 | |
number_key |
49:69a7235d837a | 17 | void backLimit(); |
number_key |
49:69a7235d837a | 18 | |
number_key |
49:69a7235d837a | 19 | void resetPosition(); |
number_key |
49:69a7235d837a | 20 | |
number_key |
49:69a7235d837a | 21 | int getPosition(); |
number_key |
49:69a7235d837a | 22 | |
number_key |
49:69a7235d837a | 23 | private : |
number_key |
49:69a7235d837a | 24 | InterruptIn frontSwitch; |
number_key |
49:69a7235d837a | 25 | InterruptIn backSwitch; |
number_key |
49:69a7235d837a | 26 | |
number_key |
49:69a7235d837a | 27 | protected : |
number_key |
49:69a7235d837a | 28 | int position; |
number_key |
49:69a7235d837a | 29 | }; |
number_key |
49:69a7235d837a | 30 | |
number_key |
49:69a7235d837a | 31 | #endif |