Omerovic Mirza Nurif Dedagic

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 
00004 DigitalOut tacka(dp4);
00005 BusOut cifra(dp2,dp1,dp28,dp6,dp5,dp27,dp26);
00006 DigitalOut poz3(dp23);
00007 DigitalOut poz2(dp24);
00008 DigitalOut poz1(dp25);
00009 
00010 
00011 void f(int c,int pozicija){
00012 if(pozicija==0) {poz1=0;}
00013 else if(pozicija==1) {poz2=0;tacka=0;}
00014 else poz3=0;
00015 
00016 
00017 if(c==0) cifra=0x01;
00018 else if(c==1) cifra=0x4f;
00019 else if(c==2) cifra=0x12;
00020 else if(c==3) cifra=0x06;
00021 else if(c==4) cifra=0x4c;
00022 else if(c==5) cifra=0x24;
00023 else if(c==6) cifra=0x20;
00024 else if(c==7) cifra=0x0f;
00025 else if(c==8) cifra=0x0;
00026 else  cifra=0x04;
00027 wait(0.001);
00028 if(pozicija==0) poz1=1;
00029 else if(pozicija==1) poz2=1;
00030 else poz3=1;    
00031 tacka=1;  
00032     }
00033 
00034 int main() {
00035     int br=0;  
00036     int br2=0;
00037     while(1) {
00038       
00039     for(int i=0;i<10;i++){
00040         for(int j=0;j<30;j++){
00041            f(i,0);
00042            f(br,1);
00043            f(br2,2);
00044             
00045             }
00046            
00047      
00048         }
00049     br++;
00050     if(br==9){ br=0; br2++;}
00051     
00052        
00053     }
00054 }