Pejovic Luka Durakovic Adna
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 BusOut ledice(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28); 00004 00005 DigitalOut enable(dp14); 00006 DigitalIn taster(dp1); 00007 00008 int main() { 00009 00010 int broj = 0; 00011 enable = 0; 00012 ledice = broj; 00013 00014 while(1) { 00015 if(taster == 0) broj++; 00016 else broj--; 00017 00018 if(broj < 0) broj = 255; 00019 if(broj > 255) broj = 0; 00020 00021 ledice = broj; 00022 wait(1); 00023 } 00024 }
Generated on Thu Aug 11 2022 11:27:37 by
1.7.2