Below find a Potentiometer Read/Debug.Print Demo
which was written by P.J. Santoro of our local Hackerspace http://www.hive76.org
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using System.Threading;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace potApp
{
public partial class Program
{
void ProgramStarted()
{
/******************************************************************************************
Access modules defined in the designer by typing their name:
e.g. button
camera1
Initialize event handlers here.
e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);
***************************************************************************************** */
// Do one-time tasks here
Debug.Print("Program Started");
while (true)
{
double pot_val = potentiometer.ReadPotentiometerVoltage();
Debug.Print(pot_val.ToString());
Thread.Sleep(1000);
}
}
}
}