LED blinking with a small microcontroller (STM32F031/F050) with 4kB of RAM.

Dependencies:   mbed-STM32F030F4

Revision:
0:ccaa0ada3fe9
Child:
1:6d1a367bdba2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Apr 26 19:46:19 2015 +0000
@@ -0,0 +1,44 @@
+/**********************************************************************************
+* @file    main.cpp
+* @author  Marta Krepelkova
+* @version V0.1
+* @date    26-April-2015
+* @brief   LED blinking with microcontroller in a small package
+***********************************************************************************/
+ 
+/**********************************************************************************/
+/*   Table of used pins on STM32F0 Discovery kit with STM32F031F6P6 MCU (TSSOP20) */
+/**********************************************************************************/
+/*  TSSOP20 pin     |     peripheral                                              */
+/*   11 (PA_5)      |     LED                                                     */
+/**********************************************************************************/
+ 
+/* Includes ----------------------------------------------------------------------*/
+#include "mbed.h"
+
+/* Defines -----------------------------------------------------------------------*/
+ 
+/* Function prototypes -----------------------------------------------------------*/
+ 
+/* Variables ---------------------------------------------------------------------*/
+
+// mbed - initialization of peripherals
+DigitalOut myled(PA_5); // LED is connected to PA_5
+
+/* Functions----------------------------------------------------------------------*/
+
+/***********************************************************************************
+* Function Name  : main.
+* Description    : Main routine.
+* Input          : None.
+* Output         : None.
+* Return         : None.
+***********************************************************************************/
+int main() {
+    while(1) {
+        myled = 1; // LED is ON
+        wait(0.2); // 200 ms
+        myled = 0; // LED is OFF
+        wait(1.0); // 1 sec
+    }
+}