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.
Revision 1:c69f589b72b1, committed 2020-02-08
- Comitter:
- efrstek
- Date:
- Sat Feb 08 16:14:23 2020 +0000
- Parent:
- 0:cc0cf84c7541
- Commit message:
- uart
Changed in this revision
uart.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uart.h Sat Feb 08 16:14:23 2020 +0000 @@ -0,0 +1,28 @@ +#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); + } +} \ No newline at end of file