Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (31 sloc) 1006 Bytes

Grove RotaryAngleSensor modules

Version: 1.0.0-preview3

Connections

Grove RotaryAngleSensor is connected as followed on Netduino3:

Schematic

Grove RotaryAngleSensor Mainboard with base shield
Yellow wire Socket D5

Example of code:

using System.Diagnostics;
using System.Threading;
using Bauland.Grove;
using Bauland.Pins;

namespace TestRotaryAngleSensor
{
    static class Program
    {
        static void Main()
        {
            // Grove RotaryAngleSensor module is connected on A0 of Netduino 3 with base shield
            RotaryAngleSensor rotaryAngleSensor = new RotaryAngleSensor(Netduino3.AdcChannel.A0);

            while (true)
            {
                Debug.WriteLine("Percentage: " + rotaryAngleSensor.GetPercentage().ToString("F") + "%");
                Thread.Sleep(1000);
            }
        }
    }
}