2. Connect 3.3v to AREF. 3. Connect the center pin to Analog0. 4. Connect the Right pin to Ground.
using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino;
namespace temperature1 { public class Program { public static void Main() { //Declare your analog input AnalogInput a0 = new AnalogInput(Pins.GPIO_PIN_A0);
while (true) { // Read the temp sensor int read = a0.Read();
//convert the reading to voltage Double voltage = read * 3.3 / 1024;
//calculate Celsius from voltage Double tempC = (voltage - 0.5) * 100;