Gustavo Ramirez
/
lecturaAnaloga
describe una lectura analogica basica
main.cpp@1:d4b9822b8df4, 2013-10-03 (annotated)
- Committer:
- tony63
- Date:
- Thu Oct 03 21:55:19 2013 +0000
- Revision:
- 1:d4b9822b8df4
- Parent:
- 0:fd817c22d584
- Child:
- 2:7d8925e51f85
ACTUALIZADO
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tony63 | 0:fd817c22d584 | 1 | // ejemplo lectura analoga |
tony63 | 0:fd817c22d584 | 2 | // EJEMPLO CON UN LCD PARA EL MODULO FRDM-KL25Z PARA LECTURA ANALOGA |
tony63 | 0:fd817c22d584 | 3 | |
tony63 | 0:fd817c22d584 | 4 | #include "mbed.h" |
tony63 | 0:fd817c22d584 | 5 | #include "TextLCD.h" |
tony63 | 0:fd817c22d584 | 6 | AnalogIn Vin(PTC2); |
tony63 | 1:d4b9822b8df4 | 7 | TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7 |
tony63 | 0:fd817c22d584 | 8 | |
tony63 | 0:fd817c22d584 | 9 | int main( ){ |
tony63 | 0:fd817c22d584 | 10 | |
tony63 | 0:fd817c22d584 | 11 | lcd.cls(); |
tony63 | 0:fd817c22d584 | 12 | wait(0.5); |
tony63 | 0:fd817c22d584 | 13 | while(1){ |
tony63 | 0:fd817c22d584 | 14 | lcd.cls(); |
tony63 | 0:fd817c22d584 | 15 | lcd.printf("V(%f)", Vin.read()); |
tony63 | 0:fd817c22d584 | 16 | wait(0.5); |
tony63 | 0:fd817c22d584 | 17 | } |
tony63 | 0:fd817c22d584 | 18 | } |