Skip to content

Instantly share code, notes, and snippets.

@vznncv
Created February 16, 2019 11:12
Show Gist options
  • Save vznncv/8331fe0f0f58d33c3f34a58675292245 to your computer and use it in GitHub Desktop.
Save vznncv/8331fe0f0f58d33c3f34a58675292245 to your computer and use it in GitHub Desktop.
Mbed led blinking demo for STM32F3Discovery board
/**
* 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