0% found this document useful (0 votes)
9 views2 pages

Tarea 6

This code is displaying temperature readings from two sensors on a 16x2 LCD display. It defines custom characters to display the temperature symbols and indicators. In setup, it initializes the LCD and prints labels. In loop, it takes readings from the analog sensors, calculates the temperatures, displays the values on the LCD, and indicates if the average is below 0, between 0-20, or above 20 degrees.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Tarea 6

This code is displaying temperature readings from two sensors on a 16x2 LCD display. It defines custom characters to display the temperature symbols and indicators. In setup, it initializes the LCD and prints labels. In loop, it takes readings from the analog sensors, calculates the temperatures, displays the values on the LCD, and indicates if the average is below 0, between 0-20, or above 20 degrees.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <LiquidCrystal.h> B10001, lcd.

setCursor(6, 1);
#include <Wire.h> B10001, lcd.print(temperatura);
B01110,
LiquidCrystal lcd(3, 4, 5, 6, B00000, lectura2 =
7, 8); B00000, analogRead(A1);
byte termo1 [] = { B00000 temperatura2 = ((5.0 *
B10001, }; lectura2 * 100.0) /
B11111, 1024.0) - 50.0;
B10001, signed int temperatura; lcd.setCursor(6, 0);
B10001, int lectura; lcd.print(temperatura2);
B10001, signed int temperatura2; x=
B10001, int lectura2; (temperatura+temperatur
B10001, signed int x; a2)/2;
B10001
}; void setup(){ if (x < 0) {
lcd.createChar(1, lcd.setCursor(15, 0);
byte termo2 [] = { termo1); lcd.write(byte(1));
B10001, lcd.createChar(2, lcd.setCursor(15,1);
B10001, termo2); lcd.write(byte(2));
B10001, lcd.createChar(3, }
B10001, termo3);
B10001, lcd.createChar(4, if (x >= 0 && x <=20) {
B10001, termo4); lcd.setCursor(15,1);
B10001, lcd.createChar(5, lcd.write(byte(4));
B01110 gradonya); lcd.setCursor(15, 0);
}; lcd.begin(16, 2); lcd.write(byte(1));
lcd.setCursor(0, 0); }
byte termo3 [] = { lcd.print("Temp1:");
B10001, lcd.setCursor(0, 1); if (x >= 20) {
B11111, lcd.print("Temp2:"); lcd.setCursor(15, 0);
B11111, lcd.setCursor(12, 0); lcd.write(byte(3));
B11111, lcd.write (byte(5)); lcd.setCursor(15, 1);
B11111, lcd.setCursor(13, 0); lcd.write(byte(4));
B11111, lcd.print("C"); }
B11111, lcd.setCursor(12, 1);
B11111 lcd.write (byte(5));
}; lcd.setCursor(13, 1); }
lcd.print("C");
byte termo4 [] = { lcd.setCursor(15, 0);
B11111, lcd.write (byte(0));
B11111, lcd.setCursor(15, 1);
B11111, lcd.write (byte(1));
B11111,
B11111, }
B11111,
B11111, void loop()
B01110 {
}; lectura =
analogRead(A2);
byte gradonya[] = { temperatura = ((5.0 *
B01110, lectura * 100.0) / 1024.0)
B10001, - 50.0;

You might also like