Skip to main content

Class WiiExtensionControllerBase

Abstract base class that represents Nintendo Wiimote I2C extension controllers

Assembly: WiiExtensionControllers.dll
View Source
Declaration
public abstract class WiiExtensionControllerBase : II2cPeripheral

Derived:
Meadow.Foundation.Sensors.Hid.WiiClassicControllerBase

Implements:
Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

DefaultI2cSpeed

Default I2C bus speed (400kHz)

View Source
Declaration
public static I2cBusSpeed DefaultI2cSpeed { get; }

ReadBuffer

Data buffer returned by the controller

View Source
Declaration
protected Span<byte> ReadBuffer { get; }

SamplingTokenSource

Sampling cancellation token source

View Source
Declaration
protected CancellationTokenSource? SamplingTokenSource { get; set; }

IsSampling

Are we actively reading data from the extension controller

View Source
Declaration
public bool IsSampling { get; protected set; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
Declaration
protected readonly II2cCommunications i2cComms

samplingLock

Lock for sampling

View Source
Declaration
protected object samplingLock

Methods

Initialize()

Initialize the extension controller

View Source
Declaration
protected virtual void Initialize()

Update()

Get the latest sensor data from the device

View Source
Declaration
public virtual void Update()

GetIdentification()

Gets the device ID

View Source
Declaration
public byte[] GetIdentification()
Returns

System.Byte[]: The ID as a byte### StartUpdating(TimeSpan) Starts continuously sampling the sensor

View Source
Declaration
public void StartUpdating(TimeSpan updateInterval)
Parameters
TypeNameDescription
System.TimeSpanupdateIntervalinterval between samples

StopUpdating()

Stops sampling the extension controller

View Source
Declaration
public void StopUpdating()

Implements

  • Meadow.Hardware.II2cPeripheral