3 releases
0.1.2 | Apr 21, 2021 |
---|---|
0.1.1 | Apr 21, 2021 |
0.1.0 | Apr 21, 2021 |
#1876 in Hardware support
11KB
133 lines
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();
}
}
Dependencies
~71KB