Osvaldo Neto / Mbed 2 deprecated Projeto

Dependencies:   DTH TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
OsvaldoTNeto
Date:
Mon Nov 21 22:32:38 2016 +0000
Parent:
0:023d17fe2a19
Commit message:
Vers?o Est?vel

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sun Nov 20 19:08:15 2016 +0000
+++ b/main.cpp	Mon Nov 21 22:32:38 2016 +0000
@@ -29,6 +29,8 @@
 DigitalIn btnEnter(PTC5);
 //Led interno Vermelho
 DigitalOut led(LED1);
+//Led interno Verde
+DigitalOut ledV(LED2);
 
 //Função que exibe a temperatua no LCD
 void ExibeTemperatura(float temperatura)
@@ -50,13 +52,15 @@
 {
     //Apaga o LED Vermelho da Placa
     led = 1;
+    //Acende o LED Verde da Placa
+    ledV = 0;
     
     //Define a tempertura inicial de escolha como 25 graus celcius
     float temperatura = 25;
     
     //Escreve o texto abaixo na primeira linha do LCD
     lcd.locate(0,0);
-    lcd.printf("Set Temp Celcius");
+    lcd.printf("Set Temp Celsius");
     
     //Exibe a temperatura inicial no LCD
     ExibeTemperatura(temperatura);
@@ -117,14 +121,17 @@
      if (temperaturaS > temperatura)
      {
       // Dispara o alarme com um sinal luminoso no LED Vermelho da Placa
-      while(1)
-      {
-       led = 0;
-       wait(0.1);
-       led = 1;
-       wait(0.1);   
-      }    
+      //Apaga o LED Verde
+      ledV = 1;
+      //Acende o LED Vermelho
+      led = 0;
+      wait(0.1);
+      led = 1;
+      wait(0.1);   
+      //}    
      }
+     else
+        ledV = 0; //Acende LED Verde
      
      //Espera 1 segundo para realizar uma nova leitura do sensor
      wait(1);