Nuhodzic Muris Kusundzija Elma

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 BusOut myled(dp23,dp24,dp25,dp26,dp27,dp5,dp6,dp28);
00004 DigitalOut enable(dp14);
00005 DigitalIn taster1(dp1);
00006 DigitalIn taster2(dp2);
00007 
00008 int main() {
00009     enable=0;
00010     int broj=0;
00011     int ind=0;
00012     while(1) {
00013         ind=0;
00014         while(taster1==1){
00015             if(ind==0){
00016             ind=1;
00017             
00018             myled=broj;
00019             if(broj==255) broj=0;
00020             else broj++;}
00021             wait(0.5);
00022         }
00023         ind=0;
00024         while( taster2==1){
00025             if(ind==0){
00026             ind=1;
00027             
00028             myled=broj;
00029             if(broj==0) broj=255;
00030             else broj--;} 
00031             wait(0.5);
00032          }  
00033          }
00034          }