Struct sensehat::SenseHat[][src]

pub struct SenseHat<'a> { /* fields omitted */ }

Represents the Sense HAT itself.

Methods

impl<'a> SenseHat<'a>
[src]

Try and create a new SenseHat object.

Will open the relevant I2C devices and then attempt to initialise the chips on the Sense HAT.

Returns a Temperature reading from the barometer. It's less accurate than the barometer (+/- 2 degrees C), but over a wider range.

Returns a Pressure value from the barometer

Returns a Temperature reading from the humidity sensor. It's more accurate than the barometer (+/- 0.5 degrees C), but over a smaller range.

Returns a RelativeHumidity value in percent between 0 and 100

Returns a vector representing the current orientation, using all three sensors.

Get the compass heading (ignoring gyro and magnetometer)

Returns a vector representing the current orientation using only the gyroscope.

Returns a vector representing the current orientation using only the accelerometer.

Returns a vector representing the current acceleration in Gs.

Displays a scrolling message on the LED matrix. Blocks until the entire message has scrolled past.

The interval can be a std::time::Duration or an Fps (frames per second).

The fg and bg values set the foreground and background colours. You can either specify:

  • a constant colour like Colour::WHITE,
  • a string from the W3C basic keywords like "white" or "purple", or
  • an RGB 8-bit triple like (0, 0xFF, 0).

Displays a scrolling message on the LED matrix. Blocks until the entire message has scrolled past. Scrolls at a fixed 10 frames per second.

The fg and bg values set the foreground and background colours. You can either specify:

  • a constant colour like Colour::WHITE,
  • a string from the W3C basic keywords like "white" or "purple", or
  • an RGB 8-bit triple like (0, 0xFF, 0).

Clears the LED matrix

Auto Trait Implementations

impl<'a> Send for SenseHat<'a>

impl<'a> Sync for SenseHat<'a>