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.
Fork of Minor_test_serial by
main.cpp
- Committer:
- JorineOosting
- Date:
- 2018-09-17
- Revision:
- 2:43637941ea73
- Parent:
- 1:40470bc517f1
- Child:
- 3:d8ad579c9fef
File content as of revision 2:43637941ea73:
#include "mbed.h"
#include "MODSERIAL.h"
DigitalOut myled(LED_GREEN);
MODSERIAL pc(USBTX, USBRX);
int main()
{
pc.baud(115200); //setup of bits per second
pc.printf("Hello World!\r\n");
while (true) {
if(pc.readable()){ // returns 1 if there is a byte available, 0 if not
char c; // create character
c = pc.getc(); // character comes from input pc
pc.putc(c); // print input character on screen
//pc.printf("\n"); //print enter after character
myled = !myled; // toggle a led
}
}
}
