simple tests for STM32F100R6 microcontroller with dedicated library
Dependencies: mbed-STM32F100R6
To compile a program with this library, use NUCLEO-F103RB as the target name. !
Change only one "#if" to "#if 1" to select the desired test. Others "#if" must be "#if 0".
Diff: main.cpp
- Revision:
- 0:5057d688da32
- Child:
- 1:5bc8c8e22eda
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jan 01 23:47:27 2016 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" + +DigitalOut myled(PB_0); + +int main() +{ + +// sysclk test + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1); // 24 MHz + + while(1) { + myled = 1; // LED is ON + wait(0.99); // 200 ms + myled = 0; // LED is OFF + wait(0.01); // 1 sec + myled = 1; // LED is ON + wait(0.8); // 200 ms + myled = 0; // LED is OFF + wait(0.2); // 1 sec + //HAL_Delay(1000); + } +}