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 Zoltan Hudak

main.cpp

Committer:
hudakz
Date:
2016-09-15
Revision:
10:4b88be251088
Parent:
9:d3fb631890d7
Child:
11:b6d4d3f90831

File content as of revision 10:4b88be251088:

#include "stm32f103c8t6.h"
#include "mbed.h"
  
int main() {
    confSysClock();     //Configure system clock (72MHz HSE clock, 48MHz USB clock)
    
    Serial      pc(PA_2, PA_3);
    DigitalOut  myled(LED1);
    
    while(1) {
        // The on-board LED is connected, via a resistor, to +3.3V (not to GND). 
        // So to turn the LED on or off we have to set it to 0 or 1 respectively
        myled = 0;      // turn the LED on
        wait_ms(200);   // 200 millisecond
        myled = 1;      // turn the LED off
        wait_ms(1000);  // 1000 millisecond
        pc.printf("Blink\r\n");
    }
}