Started a new example for 1.54 in

This commit is contained in:
Christoph Groß
2018-09-17 16:34:49 +02:00
parent 06517e053e
commit 4c704a3af5
5 changed files with 184 additions and 5 deletions
+2 -1
View File
@@ -61,10 +61,11 @@ impl<'a> InputPin for HackInputPin<'a> {
fn main() {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(1_000_000)
.max_speed_hz(4_000_000)
.mode(spidev::SPI_MODE_0)
.build();
spi.configure(&options).expect("spi configuration");