Thanks to Zoltan Hudak publish the way to use STM32F103c8t6 on mbed. Now, this example can let you use it with a encoder.
Dependencies: QEI mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_Hello by
Diff: main.cpp
- Revision:
- 11:b6d4d3f90831
- Parent:
- 10:4b88be251088
--- a/main.cpp Thu Sep 15 18:40:03 2016 +0000 +++ b/main.cpp Tue May 23 16:45:28 2017 +0000 @@ -1,10 +1,12 @@ #include "stm32f103c8t6.h" #include "mbed.h" - +#include "QEI.h" + int main() { confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) Serial pc(PA_2, PA_3); + QEI wheel (PB_9, PB_8, NC, 624); DigitalOut myled(LED1); while(1) { @@ -14,7 +16,6 @@ wait_ms(200); // 200 millisecond myled = 1; // turn the LED off wait_ms(1000); // 1000 millisecond - pc.printf("Blink\r\n"); + pc.printf("Pulses is: %i\n", wheel.getPulses());//pc.printf("Blink\r\n"); } } - \ No newline at end of file