Are any known issues with the EncoderController that is part of the standard driver library.
Using pins PE7 and PE8, there is no indication of rotation. Code is shown below. Builds and executes with no errors.
using System;
using System.Diagnostics;
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Pins;
using GHIElectronics.TinyCLR.Drivers.Encoder;
using System.Threading;
namespace TestEncoder
{
internal class Program
{
static void Main()
{
var gpioController = GpioController.GetDefault();
var pinA = gpioController.OpenPin(FEZFeather.GpioPin.PE7);
var pinB = gpioController.OpenPin(FEZFeather.GpioPin.PE8);
var encoder = new EncoderController(pinA, pinB);
encoder.OnCounterChangedEvent += (counter) =>
{
Debug.WriteLine("Counter = " + counter);
};
Thread.Sleep(Timeout.Infinite);
}
}
}