Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LCD_test by
Revision 1:d7f3caab54a5, committed 2015-11-27
- Comitter:
- josedaparte
- Date:
- Fri Nov 27 14:02:59 2015 +0000
- Parent:
- 0:a9f60dff8cb6
- Commit message:
- Imprime en lcd la temperatura sensada por el CAS externo y el voltaje del CAS
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r a9f60dff8cb6 -r d7f3caab54a5 main.cpp --- a/main.cpp Thu Nov 26 21:18:11 2015 +0000 +++ b/main.cpp Fri Nov 27 14:02:59 2015 +0000 @@ -2,24 +2,26 @@ #include "TextLCD.h" #include "AnalogIn.h" -AnalogIn leer(PTC1); +AnalogIn leer(PTC2); -TextLCD lcd(PTE20, PTE21, PTE22, PTE23, PTB20, PTE30, TextLCD::LCD16x2); +TextLCD lcd(PTD3, PTA12, PTA4, PTA5, PTC8, PTC9, TextLCD::LCD16x2); int main() { -float lectura; -float voltaje; + float temperatura; + float voltajecas; + uint16_t adcvalue; while(1){ - - lectura = leer.read(); - voltaje = lectura*3.3; - lcd.cls(); - lcd.printf("%f",lectura); - lcd.locate(1,1); - lcd.printf("%f", voltaje); - wait(2); + lcd.cls(); + adcvalue = leer.read_u16(); + voltajecas = adcvalue*3.3/65525; + lcd.printf("El Vcas es %.2f", voltajecas); + temperatura = voltajecas * 100 / 5 + 0.04; + lcd.locate(0,1); + lcd.printf("Hace %.0f grados", temperatura); + wait(1.5); + }