sci-oly-detector-building

[RADIOACTIVE] arduino thermometer for science olympiad
git clone git://git.figbert.com/sci-oly-detector-building.git
Log | Files | Refs | LICENSE

commit f8c61574a7b4c6d7b5b00827bfd36c8b362ceda2
parent deeb2b7abdf970b836b1fc1315046fc6b7c638e4
Author: therealFIGBERT <figbertwelner@gmail.com>
Date:   Wed, 19 Feb 2020 23:14:10 -0800

:heavy_plus_sign: Change LCD library to hd44780 Extensible

Diffstat:
MRoughDraft/RoughDraft.ino | 17+++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/RoughDraft/RoughDraft.ino b/RoughDraft/RoughDraft.ino @@ -1,24 +1,21 @@ +#include <hd44780.h> #include <Wire.h> -#include <LiquidCrystal_I2C.h> -LiquidCrystal_I2C lcd(0x27, 16, 2); +#include <hd44780ioClass/hd44780_I2Cexp.h> +hd44780_I2Cexp lcd; void setup() { - lcd.init(); + lcd.begin(16, 2); lcd.backlight(); Serial.begin(9600); - int thermistor = A0; - float R1 = 10000; - float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07; } void loop() { - int sensorValue = analogRead(thermistor) + int sensorValue = analogRead(A0) float voltage = sensorValue * (3.3 / 1023.0); float celsius = (voltage - 0.5) * 100; float fahrenheit = (celsius * 9.0 / 5.0) + 32.0; lcd.setCursor(5, 0); - lcd.print(String(celsius) + "C"); + lcd.write(String(celsius) + "C"); lcd.setCursor(5, 1); - lcd.print(String(fahrenheit) + "F"); + lcd.write(String(fahrenheit) + "F"); } -