Proyecto emprendetronika
Dependencies: freetronicsLCDShield mbed
Fork of prototipo by
Diff: main.cpp
- Revision:
- 0:c7f387fc3773
- Child:
- 1:5372d7ce92ff
diff -r 000000000000 -r c7f387fc3773 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 27 22:12:23 2014 +0000 @@ -0,0 +1,63 @@ +#include "mbed.h" +#include "freetronicsLCDShield.h" + +freetronicsLCDShield lcd(D8, D9, D4, D5, D6, D7, D3, A0); +DigitalOut valvula1(PTC12); +DigitalOut valvula2(PTC13); +DigitalOut valvula3(PTC16); +DigitalOut valvula4(PTC17); +DigitalIn switch1(PTB8); +DigitalIn switch2(PTB9); +DigitalIn switch3(PTB10); +DigitalIn switch4(PTB11); +AnalogIn pot1(PTB0); +AnalogIn pot2(PTB1); +AnalogIn pot3(PTB2); +AnalogIn pot4(PTB3); +Timer t; + +float tiempo; + +int main() { + while(1){ + if(PTB8==1){ + + } + } + + /*lcd.printf("prototipo SR1"); + wait(3); + t.start(); + lcd.setCursorPosition(1, 0); + lcd.printf("counter"); + + while(1){ + tiempo=t.read(); + lcd.setCursorPosition(1, 8); + lcd.printf("%f", tiempo); + if(t>=0 && t<6){ + valvula1=1; + valvula2=0; + valvula3=0; + valvula4=0; + //lcd.printf("%d", t); + }else if(t>=6 && t<12){ + valvula1=0; + valvula2=1; + valvula3=0; + valvula4=0; + }else if(t>=12 && t<18){ + valvula1=0; + valvula2=0; + valvula3=1; + valvula4=0; + }else if(t>=18 && t<24){ + valvula1=0; + valvula2=0; + valvula3=0; + valvula4=1; + }else if(t>=24){ + t.reset(); + } + }*/ +} \ No newline at end of file