Armin Klačar Maedeh Mousavi

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 brojac(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28);
00004 DigitalIn t1(dp1);
00005 DigitalOut enable(dp14);
00006 
00007 int main()
00008 {
00009     int broj = 0;
00010     enable = 0;
00011     brojac = 0;
00012     while(1)
00013     {
00014         if(!t1)
00015         {
00016             if(broj == 255) broj = 0;
00017             brojac = broj;
00018             broj++;
00019             wait(1);
00020         }
00021         else
00022         {
00023             if(!broj) broj = 255;
00024             brojac = broj;
00025             broj--;
00026             wait(1);
00027         }
00028     }
00029 }