Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- ploureiro
- Date:
- 2022-08-03
- Revision:
- 0:30590decb1a0
File content as of revision 0:30590decb1a0:
#include "mbed.h"
/*
This example shows the simplest thing you can do with an STM32 to see
physical output: it blinks the on-board LED.
use: screen /dev/ttyS0 115200 (Linux)
You can detach from the screen session at any time by typing:
Ctrl+a d
*/
DigitalOut led(LED1);
//interface série
Serial pc(PA_2, PA_3, 115200);
//Serial pc(SERIAL_TX, SERIAL_RX, 115200); // pc communication
int main()
{
while(1) {
pc.printf("Hello \r\n");
// printf("\nok\n");
led = 1; // LED is ON
wait(5); // Wait 0.2 s
led = 0; // LED is OFF
wait(5); // Wait 0.2 s
// led = 1; // LED is ON
// wait(2); // Wait 1 s
// led = 0; // LED is OFF
// wait(2); // Wait 1 s
}
}