The Arduino Starter Kit and Basic Kit
Topic: Project 3
(Read 880 times)
Jan 01, 2015, 07:37 pm
I'm currently doing Project 3 and i'm not sure what's going wrong. The temperature I get is always negative (-18.26 pretty much all the time) and my Sensor Value is always around 65. I think my installation is okay, but I can't find the flaw in my code. Could anyone help? I'll post my code here.
downloaded 142 times
Re: Project 3
Jan 02, 2015, 01:43 pm
You need to call analogRead(), not digitalRead(). This is explained on p. 46, the paragraph second to the bottom of the page.
digitalRead will only check if the pin is high/low, whilst analogRead represents the voltage of the pin with a scale from 0 to 1023.