pmw3901

Crates.iopmw3901
lib.rspmw3901
version1.0.0
sourcesrc
created_at2018-07-31 05:40:29.490439
updated_at2018-07-31 05:40:29.490439
descriptionLibrary for the PMW3901 optical flow sensor.
homepage
repositoryhttps://github.com/braincore/pmw3901-rs
max_upload_size
id76751
size12,635
Ken Elkabany (braincore)

documentation

README

PMW3901 Library for Rust Latest Version Documentation

A library for the PMW3901 optical flow sensor.

Intended to be deployed in a linux environment with spidev.

Usage

See examples/scan.rs.

Limitations

The datasheet for the PMW3901 is sparse. The list of registers comes with little explanation. This library does the bare minimum to read pixel velocity.

In addition, the initialization write sequence is opaque and is simply copied from Bitcraze.

Testing

Use environment variables to specify the SPI bus and chip select:

PMW3901_SPI_BUS=0 PMW3901_SPI_CS=0 cargo test

Tested on the breakout board by Pesky Product.

Todo

  • Control over the EN pin. Currently assumes it's pulled up.
  • Motion detection interrupt pin.
  • Control over the NRESET pin. Currently assumes it's pulled up.
Commit count: 1

cargo fmt