This gist was automatically pasted at the request of the code author or one of the discord server helpers. If you have any suggestions or bugs to report, you can do so on our GitHub repository, or in our discord server. This project is run by volunteers so feel free to fork and commit your changes then open a pull request!
Created
November 22, 2020 20:36
-
-
Save ArduinoDiscordBot/d885c22eacc9677868a9e98c826909b6 to your computer and use it in GitHub Desktop.
Code by TheAlchemist#0033 - Sun Nov 22 2020 20:36:29 GMT+0000 (Coordinated Universal Time)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpp | |
for (int i = 0; i < 15; i++) { | |
int analog_value = analogRead(A0); | |
R_therm = 1e5 * ((5.0 / Vin) - 1); | |
tempAVG = 0; | |
Vin = (analog_value) * (5.00 / 1023); | |
tempAVG = Vin + tempAVG; | |
RTemp = 1.00 + ((((651 + (-50.2 * log(R_therm))) - 32) * 5.00) / 9.00); | |
average = average + RTemp; | |
} | |
average = average / 15; | |
Serial.println(RTemp); | |
Serial.print("Average T: "); | |
Serial.println(average); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment