From 3bddb71d56d5d556a41779f04b4fefa135f319cd Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 29 Mar 2015 22:08:57 +0200 Subject: Blink LED. --- main.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..57b1ed0 --- /dev/null +++ b/main.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +Pin led_green = GPIOC[8]; +Pin led_blue = GPIOC[9]; + +int main() { + // Initialize system timer. + STK.LOAD = 8000000 / 8 / 1000; // 1000 Hz. + STK.CTRL = 0x03; + + RCC.enable(RCC.GPIOC); + + led_green.set_mode(Pin::Output); + + while(1) { + Time::sleep(500); + + led_green.toggle(); + } +} -- cgit v1.2.3