sheldon holmes / Mbed 2 deprecated Lciis

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Decoder.cpp Source File

Decoder.cpp

00001 #include "mbed.h"
00002 #include "Decoder.h"
00003 
00004 DigitalIn dec0(PB_7);
00005 DigitalIn dec1(PA_15);
00006 DigitalIn dec2(PA_14);
00007 DigitalIn dec3(PA_13);
00008 
00009 int gb = 0;
00010 
00011 Decoder::Decoder()
00012 {}
00013 
00014 int Decoder::checkIn()
00015 {
00016     int d = 0;
00017     if(dec0==1)
00018     {
00019         d=d+1;
00020     }
00021     if(dec1==1)
00022     {
00023         d=d+2;
00024     }
00025     if(dec2==1)
00026     {
00027         d=d+4;
00028     }
00029     if(dec3==1)
00030     {
00031         d=d+8;
00032     }
00033     return(d);
00034 }
00035 
00036 void Decoder::control(){
00037     int rc = checkIn();
00038     if(rc==15)
00039     {
00040         
00041     }
00042     if(rc==14)
00043     {
00044         
00045     }
00046     if(rc==13)
00047     {
00048         
00049     }
00050 }