Skip to main content

Meadow.Foundation.Sensors.Hid.As5013

As5013
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Sensors.Hid.As5013

Code Example

As5013 joystick;

public override Task Initialize()
{
Resolver.Log.Info("Initializing ...");

joystick = new As5013(Device.CreateI2cBus());

joystick.Updated += As5013_Updated;

return Task.CompletedTask;
}

public override Task Run()
{
joystick.StartUpdating(TimeSpan.FromMilliseconds(100));

return Task.CompletedTask;
}

private void As5013_Updated(object sender, IChangeResult<Meadow.Peripherals.Sensors.Hid.AnalogJoystickPosition> e)
{
Resolver.Log.Info($"{e.New.Horizontal}, {e.New.Vertical}");
}

Sample project(s) available on GitHub

Wiring Example

To wire a As5013 to your Meadow board, connect the following:

As5013Meadow Pin
GNDGND
SCLD08 (SCL)
SDAD07 (SDA)
VCC3V3