Bayley Wang
/
analoghalls
potato
Fork of analoghalls by
Diff: main.cpp
- Revision:
- 2:b5c19d4eddcc
- Parent:
- 1:70eed554399b
- Child:
- 3:86ccde39f61b
--- a/main.cpp Sat Feb 21 21:39:33 2015 +0000 +++ b/main.cpp Mon Feb 23 19:42:50 2015 +0000 @@ -1,4 +1,6 @@ #include "mbed.h" + + #include "constants.h" #include "shared.h" #include "util.h" @@ -13,17 +15,22 @@ DigitalOut en(_EN); +DigitalIn dummy(D5); + AnalogIn throttle(_THROTTLE); AnalogIn analoga(_ANALOGA); AnalogIn analogb(_ANALOGB); Motor* motor; -Ticker dtc_upd_ticker, throttle_upd_ticker; +#ifdef __USE_THROTTLE + Ticker dtc_upd_ticker; + Ticker throttle_upd_ticker; +#endif float throttle_read; -int main() { +int main() { en = 1; initTimers(); @@ -31,7 +38,12 @@ initData(); while(1) { +#ifdef __USE_THROTTLE throttle_read = throttle; +#endif pos_update(); +#ifndef __USE_THROTTLE + dtc_update(); +#endif } }