Skip to main content

Class Mpr121

Represents the MPR121 12-Key Capacitive Touch Sensor

Assembly: Mpr121.dll
View Source
public class Mpr121 : II2cPeripheral

Implements:
Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

RefreshPeriod

Gets or sets the period in milliseconds to refresh the channels statuses.

View Source
public int RefreshPeriod { get; set; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
protected readonly II2cCommunications i2cComms

Methods

ReadChannelStatus(Channels)

Reads the channel status of MPR121 controller.

View Source
public bool ReadChannelStatus(Mpr121.Channels channel)
Returns

System.Boolean

Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Hid.Mpr121.ChannelschannelThe channel to read status.

ReadChannelStatuses()

Reads the channel statuses of MPR121 controller.

View Source
public IReadOnlyDictionary<Mpr121.Channels, bool> ReadChannelStatuses()
Returns

System.Collections.Generic.IReadOnlyDictionary<Meadow.Foundation.Sensors.Hid.Mpr121.Channels,System.Boolean>

Events

ChannelStatusesChanged

Notifies about a the channel statuses have been changed. Refresh period can be changed by setting PeriodRefresh property.

View Source
public event EventHandler<ChannelStatusChangedEventArgs> ChannelStatusesChanged
Event Type

System.EventHandler<Meadow.Foundation.Sensors.Hid.ChannelStatusChangedEventArgs>

Implements

  • Meadow.Hardware.II2cPeripheral