Haris Spahić Josip Kvesić
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 BusOut myled(dp23,dp24,dp25,dp26,dp27,dp5,dp6,dp28); 00004 DigitalOut enable(dp14); 00005 DigitalIn taster(dp1); 00006 int main() { 00007 enable=0; 00008 int brojac=0; 00009 while(1) { 00010 if(taster==0){ 00011 myled=brojac; 00012 brojac++; 00013 wait(1); 00014 if(brojac>255) brojac=0; 00015 } 00016 else if(taster==1){ 00017 myled=brojac; 00018 brojac--; 00019 wait(1); 00020 if(brojac<0) brojac=255; 00021 } 00022 } 00023 }
Generated on Wed Aug 10 2022 03:25:53 by
1.7.2