When I try to read to onboard temperature sensor I get some really high numbers?
Which is not what I expect at all. I expect to get the current room temperature in Celsius.
I managed to fix the wide range of temperature the problem was my battery.
But the output is still quite unfiltered and unstable. Does anyone know how to fix this? Add capacitors maybe?
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
lcd.begin(16, 2); // set up lcd.
lcd.print("Hello world"); // make sure cld is working.
delay(1000);
lcd.clear(); // get lcd Ready
}
void loop() {
lcd.print( analogReadTemp() ); // Try to print out on board temperature.
delay(1000);
lcd.clear();
// put your main code here, to run repeatedly:
}
void setup1() {
Serial.begin(2400); // Using the second core too serial print temperature to computer
}
void loop1() {
Serial.println( analogReadTemp() );
delay(100);
}
The "noise" seems pretty quantized. Maybe one or two LSBs of the ADC. I certainly wouldn't get bent about that. Adding @gru2x2 to my "Ignore Questions from these People" list.