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:
- Frankqg
- Date:
- 2017-09-23
- Revision:
- 0:803792acd19e
- Child:
- 1:25542223771f
File content as of revision 0:803792acd19e:
#include "mbed.h"
#include "SoftSerial.h"
SoftSerial nucleo (D8,D9);
Serial pc(SERIAL_TX, SERIAL_RX);
char sent,rec;
int i =0;
int k =0;
int main()
{
char msm[25]= {};
char led[25]= {};
char com[3] = {'o','f','f'};
while(1) {
if (pc.readable()>0) {
sent=pc.getc();
if(sent == 13) {
for (int j = 0; j<i; j++) {
nucleo.printf("%c",msm[j]);
pc.printf("%c",msm[j]);
wait(0.01);}
nucleo.printf("\n\r");
pc.printf("\n\r");
i=0;
} else {
msm[i]=sent;
i++;
}
}
if(nucleo.readable()>0) {
rec=nucleo.getc();
pc.printf("%c",rec);
wait(0.01);
led[k]=rec;
k++;
}
}
}