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
main.cpp
- Committer:
- DudeHD
- Date:
- 2019-01-05
- Revision:
- 0:fd986657942a
File content as of revision 0:fd986657942a:
#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