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.
Diff: uart.h
- Revision:
- 4:e360384c268b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/uart.h Mon Jun 08 17:48:51 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