proyectotecnicas
/
LCD_test_teclado
prueba teclado matricial 4x3
Fork of LCD_test by
main.cpp@0:a9f60dff8cb6, 2015-11-26 (annotated)
- Committer:
- josedaparte
- Date:
- Thu Nov 26 21:18:11 2015 +0000
- Revision:
- 0:a9f60dff8cb6
- Child:
- 1:85232e54cfcf
hgfhd
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
josedaparte | 0:a9f60dff8cb6 | 1 | #include "mbed.h" |
josedaparte | 0:a9f60dff8cb6 | 2 | #include "TextLCD.h" |
josedaparte | 0:a9f60dff8cb6 | 3 | #include "AnalogIn.h" |
josedaparte | 0:a9f60dff8cb6 | 4 | |
josedaparte | 0:a9f60dff8cb6 | 5 | AnalogIn leer(PTC1); |
josedaparte | 0:a9f60dff8cb6 | 6 | |
josedaparte | 0:a9f60dff8cb6 | 7 | TextLCD lcd(PTE20, PTE21, PTE22, PTE23, PTB20, PTE30, TextLCD::LCD16x2); |
josedaparte | 0:a9f60dff8cb6 | 8 | |
josedaparte | 0:a9f60dff8cb6 | 9 | int main() { |
josedaparte | 0:a9f60dff8cb6 | 10 | |
josedaparte | 0:a9f60dff8cb6 | 11 | float lectura; |
josedaparte | 0:a9f60dff8cb6 | 12 | float voltaje; |
josedaparte | 0:a9f60dff8cb6 | 13 | |
josedaparte | 0:a9f60dff8cb6 | 14 | while(1){ |
josedaparte | 0:a9f60dff8cb6 | 15 | |
josedaparte | 0:a9f60dff8cb6 | 16 | lectura = leer.read(); |
josedaparte | 0:a9f60dff8cb6 | 17 | voltaje = lectura*3.3; |
josedaparte | 0:a9f60dff8cb6 | 18 | lcd.cls(); |
josedaparte | 0:a9f60dff8cb6 | 19 | lcd.printf("%f",lectura); |
josedaparte | 0:a9f60dff8cb6 | 20 | lcd.locate(1,1); |
josedaparte | 0:a9f60dff8cb6 | 21 | lcd.printf("%f", voltaje); |
josedaparte | 0:a9f60dff8cb6 | 22 | wait(2); |
josedaparte | 0:a9f60dff8cb6 | 23 | |
josedaparte | 0:a9f60dff8cb6 | 24 | |
josedaparte | 0:a9f60dff8cb6 | 25 | } |
josedaparte | 0:a9f60dff8cb6 | 26 | } |