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
Revision 11:b6d4d3f90831, committed 2017-05-23
- Comitter:
- Zeran
- Date:
- Tue May 23 16:45:28 2017 +0000
- Parent:
- 10:4b88be251088
- Commit message:
- STM32f103c8t6 encoder hello world example;
Changed in this revision
diff -r 4b88be251088 -r b6d4d3f90831 QEI.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QEI.lib Tue May 23 16:45:28 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/aberk/code/QEI/#5c2ad81551aa
diff -r 4b88be251088 -r b6d4d3f90831 main.cpp --- 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
diff -r 4b88be251088 -r b6d4d3f90831 mbed-STM32F103C8T6.lib --- a/mbed-STM32F103C8T6.lib Thu Sep 15 18:40:03 2016 +0000 +++ b/mbed-STM32F103C8T6.lib Tue May 23 16:45:28 2017 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/hudakz/code/mbed-STM32F103C8T6/#9fbbea76d6f6 +http://mbed.org/users/hudakz/code/mbed-STM32F103C8T6/#09d8c2eacb4d