![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
web server load-drive and reading sensors based on LPC1768
Dependencies: DHT22 EthernetNetIf HTTPServer mbed
LCDPrint/Print.cpp@0:3125f39d20b4, 2015-12-07 (annotated)
- Committer:
- douglasofranco
- Date:
- Mon Dec 07 14:06:24 2015 +0000
- Revision:
- 0:3125f39d20b4
Web server load-drive and reading sensors based on LPC1768
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
douglasofranco | 0:3125f39d20b4 | 1 | #include "Print.h" |
douglasofranco | 0:3125f39d20b4 | 2 | #include "Leitura.h" |
douglasofranco | 0:3125f39d20b4 | 3 | #include "TextLCD.h" |
douglasofranco | 0:3125f39d20b4 | 4 | #include "Atuadores.h" |
douglasofranco | 0:3125f39d20b4 | 5 | //#include "ACS712.h" |
douglasofranco | 0:3125f39d20b4 | 6 | |
douglasofranco | 0:3125f39d20b4 | 7 | TextLCD lcd(p10, p9, p8, p7, p6, p5); |
douglasofranco | 0:3125f39d20b4 | 8 | |
douglasofranco | 0:3125f39d20b4 | 9 | void Print::imprimezero() |
douglasofranco | 0:3125f39d20b4 | 10 | { |
douglasofranco | 0:3125f39d20b4 | 11 | lcd.cls(); |
douglasofranco | 0:3125f39d20b4 | 12 | } |
douglasofranco | 0:3125f39d20b4 | 13 | |
douglasofranco | 0:3125f39d20b4 | 14 | |
douglasofranco | 0:3125f39d20b4 | 15 | void Print::imprimeTexto() |
douglasofranco | 0:3125f39d20b4 | 16 | { |
douglasofranco | 0:3125f39d20b4 | 17 | lcd.locate(0,0); |
douglasofranco | 0:3125f39d20b4 | 18 | lcd.printf ("SIST. MONITORAMENTO"); |
douglasofranco | 0:3125f39d20b4 | 19 | lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 20 | lcd.printf (" "); |
douglasofranco | 0:3125f39d20b4 | 21 | lcd.locate(0,2); |
douglasofranco | 0:3125f39d20b4 | 22 | lcd.printf (" "); |
douglasofranco | 0:3125f39d20b4 | 23 | lcd.locate(0,3); |
douglasofranco | 0:3125f39d20b4 | 24 | lcd.printf (" "); |
douglasofranco | 0:3125f39d20b4 | 25 | } |
douglasofranco | 0:3125f39d20b4 | 26 | void Print::imprimeTemp() |
douglasofranco | 0:3125f39d20b4 | 27 | { |
douglasofranco | 0:3125f39d20b4 | 28 | if (err == 0) { |
douglasofranco | 0:3125f39d20b4 | 29 | lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 30 | lcd.printf (" "); |
douglasofranco | 0:3125f39d20b4 | 31 | lcd.locate(0,2); |
douglasofranco | 0:3125f39d20b4 | 32 | lcd.printf("Temperatura:"); |
douglasofranco | 0:3125f39d20b4 | 33 | lcd.printf("%d",szTemp); |
douglasofranco | 0:3125f39d20b4 | 34 | lcd.printf("\nHumidade:"); |
douglasofranco | 0:3125f39d20b4 | 35 | lcd.locate(12,3); |
douglasofranco | 0:3125f39d20b4 | 36 | lcd.printf("%d",szUmid); |
douglasofranco | 0:3125f39d20b4 | 37 | } else |
douglasofranco | 0:3125f39d20b4 | 38 | lcd.printf("\nErr %i \n",err); |
douglasofranco | 0:3125f39d20b4 | 39 | } |
douglasofranco | 0:3125f39d20b4 | 40 | // } |
douglasofranco | 0:3125f39d20b4 | 41 | void Print::imprimeCurr() |
douglasofranco | 0:3125f39d20b4 | 42 | { |
douglasofranco | 0:3125f39d20b4 | 43 | // lcd.cls(); |
douglasofranco | 0:3125f39d20b4 | 44 | lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 45 | lcd.printf("Corrente1: %s",Corrente); |
douglasofranco | 0:3125f39d20b4 | 46 | lcd.printf(" A"); |
douglasofranco | 0:3125f39d20b4 | 47 | lcd.locate(0,2); |
douglasofranco | 0:3125f39d20b4 | 48 | lcd.printf("Corrente2: %s",Corrente2); |
douglasofranco | 0:3125f39d20b4 | 49 | lcd.printf(" A"); |
douglasofranco | 0:3125f39d20b4 | 50 | lcd.locate(0,3); |
douglasofranco | 0:3125f39d20b4 | 51 | lcd.printf("Corrente3: %s",Corrente3); |
douglasofranco | 0:3125f39d20b4 | 52 | lcd.printf(" A"); |
douglasofranco | 0:3125f39d20b4 | 53 | // lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 54 | // lcd.printf("Tensao:",Tensao); |
douglasofranco | 0:3125f39d20b4 | 55 | } |
douglasofranco | 0:3125f39d20b4 | 56 | |
douglasofranco | 0:3125f39d20b4 | 57 | void Print::imprimeCC() |
douglasofranco | 0:3125f39d20b4 | 58 | { |
douglasofranco | 0:3125f39d20b4 | 59 | lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 60 | lcd.printf("Baterias: %.2f",Tcc); |
douglasofranco | 0:3125f39d20b4 | 61 | lcd.printf(" V"); |
douglasofranco | 0:3125f39d20b4 | 62 | lcd.locate(0,2); |
douglasofranco | 0:3125f39d20b4 | 63 | if (AC == 1) { |
douglasofranco | 0:3125f39d20b4 | 64 | lcd.printf("Rede Eletrica : ON"); } |
douglasofranco | 0:3125f39d20b4 | 65 | else if (AC == 0){ |
douglasofranco | 0:3125f39d20b4 | 66 | lcd.printf("Rede Eletrica : OFF"); } |
douglasofranco | 0:3125f39d20b4 | 67 | lcd.locate(0,3); |
douglasofranco | 0:3125f39d20b4 | 68 | lcd.printf (" "); |
douglasofranco | 0:3125f39d20b4 | 69 | } |
douglasofranco | 0:3125f39d20b4 | 70 | |
douglasofranco | 0:3125f39d20b4 | 71 | void Print::imprimeAviso() |
douglasofranco | 0:3125f39d20b4 | 72 | { |
douglasofranco | 0:3125f39d20b4 | 73 | // lcd.locate(0,0); |
douglasofranco | 0:3125f39d20b4 | 74 | // lcd.printf ("SIST. MONITORAMENTO "); |
douglasofranco | 0:3125f39d20b4 | 75 | lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 76 | lcd.printf ("Atuador ativado de "); |
douglasofranco | 0:3125f39d20b4 | 77 | lcd.locate(0,2); |
douglasofranco | 0:3125f39d20b4 | 78 | lcd.printf ("forma manual e sera "); |
douglasofranco | 0:3125f39d20b4 | 79 | lcd.locate(0,3); |
douglasofranco | 0:3125f39d20b4 | 80 | lcd.printf ("desativado em 8:00h "); |
douglasofranco | 0:3125f39d20b4 | 81 | lcd.locate(0,0); |
douglasofranco | 0:3125f39d20b4 | 82 | } |
douglasofranco | 0:3125f39d20b4 | 83 | |
douglasofranco | 0:3125f39d20b4 | 84 | void Print::imprimeAviso2() |
douglasofranco | 0:3125f39d20b4 | 85 | { |
douglasofranco | 0:3125f39d20b4 | 86 | //lcd.locate(0,0); |
douglasofranco | 0:3125f39d20b4 | 87 | //lcd.printf ("SIST. MONITORAMENTO "); |
douglasofranco | 0:3125f39d20b4 | 88 | lcd.locate(0,1); |
douglasofranco | 0:3125f39d20b4 | 89 | lcd.printf ("Atuador desastivado "); |
douglasofranco | 0:3125f39d20b4 | 90 | lcd.locate(0,2); |
douglasofranco | 0:3125f39d20b4 | 91 | lcd.printf ("manualmente e sera "); |
douglasofranco | 0:3125f39d20b4 | 92 | lcd.locate(0,3); |
douglasofranco | 0:3125f39d20b4 | 93 | lcd.printf ("reativado em 0:30h "); |
douglasofranco | 0:3125f39d20b4 | 94 | lcd.locate(0,0); |
douglasofranco | 0:3125f39d20b4 | 95 | } |