*
Dependencies: mbed-STM32F103C8T6 mbed
Revision 0:6345f9145b9a, committed 2017-04-29
- Comitter:
- BaserK
- Date:
- Sat Apr 29 15:30:17 2017 +0000
- Commit message:
- *
Changed in this revision
diff -r 000000000000 -r 6345f9145b9a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Apr 29 15:30:17 2017 +0000 @@ -0,0 +1,43 @@ +#include "stm32f103c8t6.h" +#include "mbed.h" + +// Timer and ticker example +// Shows how to use a timer and a ticker + +DigitalOut led(PB_12); +Ticker toggler; +Timer timer; +Serial pc(PA_2, PA_3); + +void toggle_led(); + +int main() +{ + confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) + pc.baud(9600); + + // toggle the led every 500 ms + toggler.attach(&toggle_led, 0.5); + + timer.start(); + + while (1) + { + + } +} + +void toggle_led() +{ + // change the state of the led + led = !led; + + // get the current time in ms + int time = timer.read_ms(); + + // print the time + pc.printf("Time is: %d \r\n", time); + + // reset the timer + timer.reset(); +} \ No newline at end of file
diff -r 000000000000 -r 6345f9145b9a mbed-STM32F103C8T6.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-STM32F103C8T6.lib Sat Apr 29 15:30:17 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/hudakz/code/mbed-STM32F103C8T6/#09d8c2eacb4d
diff -r 000000000000 -r 6345f9145b9a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Apr 29 15:30:17 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b0220dba8be7 \ No newline at end of file