
irrigation system for the ST Nucleo boards
Diff: Decoder.cpp
- Revision:
- 4:9e223db481da
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Decoder.cpp Sat Apr 18 21:06:58 2015 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "Decoder.h" + +DigitalIn dec0(PB_7); +DigitalIn dec1(PA_15); +DigitalIn dec2(PA_14); +DigitalIn dec3(PA_13); + +int gb = 0; + +Decoder::Decoder() +{} + +int Decoder::checkIn() +{ + int d = 0; + if(dec0==1) + { + d=d+1; + } + if(dec1==1) + { + d=d+2; + } + if(dec2==1) + { + d=d+4; + } + if(dec3==1) + { + d=d+8; + } + return(d); +} + +void Decoder::control(){ + int rc = checkIn(); + if(rc==15) + { + + } + if(rc==14) + { + + } + if(rc==13) + { + + } +} \ No newline at end of file