#adafruit #touch #status #raspberry-pi #driver #sensor #mpr121

adafruit-mpr121

Allows access and reading touch status from Adafruit MPR121

1 unstable release

0.1.0 Feb 10, 2021

#34 in #touch

MIT license

11KB
193 lines

adafruit-mpr121

Rust driver for adafruit mpr121 and raspberry pi


lib.rs:

Rust version of access to adafruit MPR121 capacitive touch sensor HAT under Linux. Completely inspired by this and that original adafruit repos. It only works with 12 input touch, numbered from 0 to 11 product info.

Default initialization:

use adafruit_mpr121::Mpr121;
let mut touch_sensor = Mpr121::new_default(1).expect("Failed to initialize sensor");
let status = touch_sensor.touch_status().unwrap();
println!("Touch status: {}", status);

Dependencies

~1.5MB
~37K SLoC