keypad2

Crates.iokeypad2
lib.rskeypad2
version0.1.1
sourcesrc
created_at2021-08-02 02:25:20.46797
updated_at2021-08-02 02:26:15.033971
descriptionA crate for reading a 3X4 keypad with embedded-hal
homepage
repositoryhttps://github.com/JohnSL/keypad2
max_upload_size
id430209
size338,186
John Socha-Leialoha (JohnSL)

documentation

README

Matrix Keypad Driver

Screen

Provides an embedded Rust driver for a common numeric matrix keypad.

Example

let rows = (
    gpiob.pb15.into_pull_up_input(&mut gpiob.crh),
    gpioa.pa7.into_pull_up_input(&mut gpioa.crl),
    gpiob.pb6.into_pull_up_input(&mut gpiob.crl),
    gpioa.pa9.into_pull_up_input(&mut gpioa.crh),
);

let cols = (
    gpioa.pa8.into_open_drain_output(&mut gpioa.crh),
    gpiob.pb5.into_open_drain_output(&mut gpiob.crl),
    gpioc.pc7.into_open_drain_output(&mut gpioc.crl),
);

let mut keypad = Keypad::new(rows, cols);

let key = keypad.read_char(&mut delay);
if key != ' ' {
    ...
}
Commit count: 4

cargo fmt