adafruit_cap1188.cap1188

CircuitPython driver for the CAP1188 8-Key Capacitive Touch Sensor Breakout.

  • Author(s): Carter Nelson, Jeremiah Rose, Jose David M.

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_cap1188.cap1188.CAP1188

CAP1188 driver base, must be extended for I2C/SPI interfacing.

property averaging: int

Samples that are taken for all active channels during the sensor cycle. All samples are taken consecutively on the same channel before the next channel is sampled and the result is averaged over the number of samples measured before updating the measured results

if CS1, CS2, and CS3 are sampled during the sensor cycle, and the AVG[2:0] bits are set to take 4 samples per channel, then the full sensor cycle will be: CS1, CS1, CS1, CS1, CS2, CS2, CS2, CS2, CS3, CS3, CS3, CS3.

property cycle: str

The programmed cycle time is only maintained if the total averaging time for all samples is less than the programmed cycle. The AVG[2:0] bits will take priority so that if more samples are required than would normally be allowed during the cycle time, the cycle time will be extended as necessary to accommodate the number of samples to be measured.

delta_count(pin: int) int

Return the 8 bit delta count value for the channel.

recalibrate() None

Perform a self recalibration on all the pins.

recalibrate_pins(mask: int) None

Recalibrate pins specified by bit mask.

property sample: str

Determines the overall cycle time for all measured channels during normal operation. All measured channels are sampled at the beginning of the cycle time. If additional time is remaining, then the device is placed into a lower power state for the remaining duration of the cycle.

property sensitivity: int

The sensitvity of touch detections. Range is 1 (least) to 128 (most).

threshold_values() Tuple[int, int, int, int, int, int, int, int]

Return tuple of touch threshold values for all channels.

property thresholds: Tuple[int, int, int, int, int, int, int, int]

Touch threshold value for all channels.

touched() int

Return 8 bit value representing touch state of all pins.

property touched_pins: Tuple[bool, bool, bool, bool, bool, bool, bool, bool]

A tuple of touched state for all pins.

class adafruit_cap1188.cap1188.CAP1188_Channel(cap1188: CAP1188, pin: int)

Helper class to represent a touch channel on the CAP1188. Not meant to be used directly.

property raw_value: int

The raw touch measurement.

recalibrate() None

Perform a self recalibration.

property threshold: int

The touch threshold value.

property value: bool

Whether the pin is being touched or not.

adafruit_cap1188.i2c

CircuitPython I2C driver for the CAP1188 8-Key Capacitive Touch Sensor Breakout.

  • Author(s): Carter Nelson

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_cap1188.i2c.CAP1188_I2C(i2c: I2C, address: int = 41)

Driver for the CAP1188 connected over I2C.

adafruit_cap1188.spi

CircuitPython SPI driver for the CAP1188 8-Key Capacitive Touch Sensor Breakout.

  • Author(s): Carter Nelson

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_cap1188.spi.CAP1188_SPI(spi: SPI, cs: DigitalInOut)

Driver for the CAP1188 connected over SPI.