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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:fd986657942a
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