Team H - TVZ Seminar / Mbed 2 deprecated KTM_05_03_M

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
DudeHD
Date:
Sat Jan 05 19:13:53 2019 +0000
Commit message:
Posto je 10 kodova samo copy paste, uploadat cu samo ove koje smo sami morali pisat

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r fd986657942a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jan 05 19:13:53 2019 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+//master program 3
+BusInOut ledout(p21,p22,p23,p24);
+BusInOut ledice(LED4,LED3,LED2,LED1);
+BusInOut datain(p20,p19,p18,p17);
+Serial uart(p28, p27);
+Ticker tick;
+char pod = 0;
+void send() {
+    uart.putc(pod);
+}
+int main() {
+    ledice.output();
+    ledout.output();
+    datain.input();
+    datain.mode(PullUp);
+    
+    uart.baud(115200);
+    uart.format(8, SerialBase::None ,1);
+    tick.attach(&send,0.1);
+
+    while(1) {
+        ledice=datain;
+        pod=datain;
+        if (uart.readable()==1) {
+            ledout = uart.getc();       
+        }
+    }
+}
+
+
+//mbed ima 3 uarta znaci 3 slave-a posto je namjenjen za komunikaciju 1 na 1
\ No newline at end of file
diff -r 000000000000 -r fd986657942a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jan 05 19:13:53 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file