Nuhodzic Muris Kusundzija Elma

Dependencies:   mbed

Fork of lab2_Grupa5_Tim010 by tim010 tim010

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 taster(dp1);
00006 
00007 int main() {
00008     enable=0;
00009     int broj=0;
00010     while(1) {
00011         if(taster==1) {
00012             myled=broj;
00013             if(broj==0) broj=255;
00014             else broj--;
00015             wait(0.5);
00016         }
00017         else if( taster==0){
00018             myled=broj;
00019             if(broj==255) broj=0;
00020             else broj++;
00021            wait(0.5);
00022          }  
00023          }
00024          }