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.
uart.h
- Committer:
- bfotak
- Date:
- 2020-06-08
- Revision:
- 4:e360384c268b
File content as of revision 4:e360384c268b:
#include "mbed.h"
Serial app(PA_2,PA_3);
short ping;
int t;
void start()
{
char pin;
pin=app.getc();
ping=pin;
}
int main()
{
app.baud(9600);
app.attach(&start, Serial::RxIrq);
while(1) {
pc.printf("Primljeni podatak: %d\n",ping);
if(ping==1) {
//start program
t=1;
}
if(ping==0) {
//stop program
t=0;
}
wait(1);
}
}