ace128_driver

Crates.ioace128_driver
lib.rsace128_driver
version0.1.2
sourcesrc
created_at2021-04-21 09:11:49.176929
updated_at2021-04-21 09:29:41.045597
descriptionAn embedded hal driver for the Bourns Absolute Contact Encoder (ACE-128)
homepage
repositoryhttps://github.com/jamesklarke/ace128
max_upload_size
id387508
size10,102
James Clarke (jamesklarke)

documentation

README

Bourns ACE128 Absolute Contacting Encoder Driver

GPIO based driver for the ACE128 Absolute Contacting Encoder.

The driver converts the 128 bit output into an absolute angle in radians as a 64 bit floating point value, with a discrete interval of 2*pi/128. An example based on the Raspberry Pi is shown below.

Example


use rppal::gpio::{Gpio, OutputPin, InputPin};
use ace128_driver::Ace128;

fn main() {

    let encoder = Ace128::new(
        Gpio::new().unwrap().get(1).unwrap().into_input(),
        Gpio::new().unwrap().get(2).unwrap().into_input(),
        Gpio::new().unwrap().get(3).unwrap().into_input(),
        Gpio::new().unwrap().get(4).unwrap().into_input(),
        Gpio::new().unwrap().get(5).unwrap().into_input(),
        Gpio::new().unwrap().get(6).unwrap().into_input(),
        Gpio::new().unwrap().get(7).unwrap().into_input(),
        Gpio::new().unwrap().get(8).unwrap().into_input()
    );

    loop {
        let angle = encoder.read_angle().unwrap();
    }
}
Commit count: 9

cargo fmt