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:
- gr91
- Date:
- 2020-10-23
- Revision:
- 6:a58f18b765cd
- Parent:
- 5:3f68adfd9cf9
- Child:
- 7:37ea12f2b18f
File content as of revision 6:a58f18b765cd:
#include "mbed.h"
//
// test led et liaison serie
// GR 2020
// Universite Paris-Saclay - IUT Cachan
//
//
Serial pc(USBTX, USBRX);
DigitalOut led(LED1);
int main()
{
pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\r\n");
led=1;
while(1) {
char c = pc.getc(); // Read hyperterminal
if (c == '0') {
led = 0; // OFF
}
if (c == '1') {
led = 1; // ON
}
}
}