proyectotecnicas
/
manejodepresion
caspresion
Diff: main.cpp
- Revision:
- 0:7602715abbe9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 10 13:20:31 2015 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "AnalogIn.h" + +TextLCD lcd(PTD3, PTA12, PTA4, PTA5, PTC8, PTC9, TextLCD::LCD16x2); +AnalogIn presionin(PTB2); +float caspresion; + +int main() +{ + while(1) { + caspresion = presionin.read() * 3.3; + lcd.cls(); + lcd.locate(0,1); + lcd.printf("%.2f",caspresion); + + if(caspresion >= 2.34){ + lcd.locate(0,0); + lcd.printf("maximo"); + } + + if(caspresion >= 1.68 && caspresion <= 1.85){ + lcd.locate(0,0); + lcd.printf("medio"); + } + + if(caspresion <= 1.03){ + lcd.locate(0,0); + lcd.printf("minimo"); + } + + wait(3); + + } +} \ No newline at end of file