Skip to content

Instantly share code, notes, and snippets.

@ArduinoDiscordBot
Created November 22, 2020 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArduinoDiscordBot/d885c22eacc9677868a9e98c826909b6 to your computer and use it in GitHub Desktop.
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 gist was pasted by the Arduino discord server bot.

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!


⬇️ Pasted Code ⬇️

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