Created
February 16, 2019 11:12
-
-
Save vznncv/8331fe0f0f58d33c3f34a58675292245 to your computer and use it in GitHub Desktop.
Mbed led blinking demo for STM32F3Discovery board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple Mbed led blinking demo for STM32F3Discovery board. | |
* | |
* It uses leds that are attached to pins PE_8 - PE_15. | |
*/ | |
#include "mbed.h" | |
int main() | |
{ | |
uint8_t mask = 0x01; | |
PortOut leds(PortE); | |
while (true) { | |
leds = mask << 8; | |
mask = (mask << 1) + (mask & 0x80 ? 0 : 1); | |
wait_ms(50); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment