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 72bd90a55cd7839b5c0ce52326c5666fa6e834c8
parent e6a06aab2593d121fa18a951849556ac5d686596
Author: therealFIGBERT <figbertwelner@gmail.com>
Date:   Tue, 18 Feb 2020 13:22:41 -0800

:sparkles: Add rough draft of final code

Diffstat:
ARoughDraft/RoughDraft.ino | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/RoughDraft/RoughDraft.ino b/RoughDraft/RoughDraft.ino @@ -0,0 +1,24 @@ +#include <Wire.h> +#include <LiquidCrystal_I2C.h> +LiquidCrystal_I2C lcd(0x27, 16, 2); + +void setup() { + lcd.init(); + 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) + 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(celsius); + lcd.setCursor(5, 1); + lcd.print(fahrenheit); +} +