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@0:63e75ced7774, 2018-10-28 (annotated)
- Committer:
- DudeHD
- Date:
- Sun Oct 28 21:51:28 2018 +0000
- Revision:
- 0:63e75ced7774
ktm 1 z3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DudeHD | 0:63e75ced7774 | 1 | //master program za paralelnu komunikaciju |
DudeHD | 0:63e75ced7774 | 2 | BusOut dataout(p21,p22,p23,p24); |
DudeHD | 0:63e75ced7774 | 3 | BusOut ledice(LED4,LED3,LED2,LED1); |
DudeHD | 0:63e75ced7774 | 4 | DigitalOut strobe(p25); |
DudeHD | 0:63e75ced7774 | 5 | DigitalIn busy(p26); |
DudeHD | 0:63e75ced7774 | 6 | BusIn datain(p20,p19,p18,p17); |
DudeHD | 0:63e75ced7774 | 7 | int main() { |
DudeHD | 0:63e75ced7774 | 8 | datain.mode(PullUp); |
DudeHD | 0:63e75ced7774 | 9 | strobe = 1; //inicijaliziraj strobe liniju |
DudeHD | 0:63e75ced7774 | 10 | wait(2); |
DudeHD | 0:63e75ced7774 | 11 | while(1) { |
DudeHD | 0:63e75ced7774 | 12 | if(busy==0){ |
DudeHD | 0:63e75ced7774 | 13 | ledice = datain; |
DudeHD | 0:63e75ced7774 | 14 | dataout = datain; |
DudeHD | 0:63e75ced7774 | 15 | wait(0.1); |
DudeHD | 0:63e75ced7774 | 16 | strobe = 0; |
DudeHD | 0:63e75ced7774 | 17 | wait(0.1); |
DudeHD | 0:63e75ced7774 | 18 | strobe = 1; |
DudeHD | 0:63e75ced7774 | 19 | } |
DudeHD | 0:63e75ced7774 | 20 | //wait(4); //cekaj novi ciklus, nepoznato vrijeme obrade slavea |
DudeHD | 0:63e75ced7774 | 21 | } |