N K
/
analoghalls_part_4
yup
Fork of analoghalls by
Diff: main.cpp
- Revision:
- 5:eeb8af99cb6c
- Parent:
- 4:f18f6bc5e1fd
- Child:
- 6:4960629abb90
--- a/main.cpp Thu Feb 26 04:49:21 2015 +0000 +++ b/main.cpp Thu Feb 26 09:50:36 2015 +0000 @@ -1,6 +1,4 @@ #include "mbed.h" - - #include "constants.h" #include "shared.h" #include "util.h" @@ -9,6 +7,7 @@ Serial pc(SERIAL_TX, SERIAL_RX); + PwmOut pha(_PH_A); PwmOut phb(_PH_B); PwmOut phc(_PH_C); @@ -21,6 +20,9 @@ AnalogIn analoga(_ANALOGA); AnalogIn analogb(_ANALOGB); +AnalogIn ia(_IA); +AnalogIn ib(_IB); + Motor* motor; #ifdef __DEBUG @@ -31,11 +33,15 @@ #ifdef __USE_THROTTLE Ticker dtc_upd_ticker; Ticker throttle_upd_ticker; + Ticker isense_upd_ticker; #endif float throttle_read; +float ia_read; +float ib_read; int main() { + pc.baud(115200); #ifdef __DEBUG pc.printf("%s\n", "Debug mode ON"); #endif @@ -51,6 +57,11 @@ #ifdef __USE_THROTTLE throttle_read = throttle; #endif + ia_read = ia; + ib_read = ib; + isense_update(); + pc.printf("%f",motor->current); + pc.printf("\n\r"); pos_update(); #ifndef __USE_THROTTLE dtc_update();