Class WiiExtensionControllerBase
Abstract base class that represents Nintendo Wiimote I2C extension controllers
Assembly: WiiExtensionControllers.dll
View Source
public abstract class WiiExtensionControllerBase : II2cPeripheral
Derived:
Meadow.Foundation.Sensors.Hid.WiiClassicControllerBase, Meadow.Foundation.Sensors.Hid.WiiNunchuck
Implements:
Meadow.Hardware.II2cPeripheral
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
DefaultI2cSpeed
Default I2C bus speed (400kHz)
View Source
public static I2cBusSpeed DefaultI2cSpeed { get; }
ReadBuffer
Data buffer returned by the controller
View Source
protected Span<byte> ReadBuffer { get; }
SamplingTokenSource
Sampling cancellation token source
View Source
protected CancellationTokenSource? SamplingTokenSource { get; set; }
IsSampling
Are we actively reading data from the extension controller
View Source
public bool IsSampling { get; protected set; }
Fields
i2cComms
I2C Communication bus used to communicate with the peripheral
View Source
protected readonly II2cCommunications i2cComms
samplingLock
Lock for sampling
View Source
protected object samplingLock
Methods
Initialize()
Initialize the extension controller
View Source
protected virtual void Initialize()
Update()
Get the latest sensor data from the device
View Source
public virtual void Update()
GetIdentification()
Gets the device ID
View Source
public byte[] GetIdentification()
Returns
System.Byte[]
: The ID as a byte### StartUpdating(TimeSpan)
Starts continuously sampling the sensor
View Source
public void StartUpdating(TimeSpan updateInterval)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | updateInterval | interval between samples |
StopUpdating()
Stops sampling the extension controller
View Source
public void StopUpdating()
Implements
Meadow.Hardware.II2cPeripheral