Struct sensehat::SenseHat [−][src]
pub struct SenseHat<'a> { /* fields omitted */ }
Represents the Sense HAT itself
Methods
impl<'a> SenseHat<'a>
[src]
impl<'a> SenseHat<'a>
pub fn new() -> SenseHatResult<SenseHat<'a>>
[src]
pub fn new() -> SenseHatResult<SenseHat<'a>>
Try and create a new SenseHat object.
Will open the relevant I2C devices and then attempt to initialise the chips on the Sense HAT.
pub fn get_temperature_from_pressure(&mut self) -> SenseHatResult<Temperature>
[src]
pub fn get_temperature_from_pressure(&mut self) -> SenseHatResult<Temperature>
Returns a Temperature reading from the barometer. It's less accurate than the barometer (+/- 2 degrees C), but over a wider range.
pub fn get_pressure(&mut self) -> SenseHatResult<Pressure>
[src]
pub fn get_pressure(&mut self) -> SenseHatResult<Pressure>
Returns a Pressure value from the barometer
pub fn get_temperature_from_humidity(&mut self) -> SenseHatResult<Temperature>
[src]
pub fn get_temperature_from_humidity(&mut self) -> SenseHatResult<Temperature>
Returns a Temperature reading from the humidity sensor. It's more accurate than the barometer (+/- 0.5 degrees C), but over a smaller range.
pub fn get_humidity(&mut self) -> SenseHatResult<RelativeHumidity>
[src]
pub fn get_humidity(&mut self) -> SenseHatResult<RelativeHumidity>
Returns a RelativeHumidity value in percent between 0 and 100
pub fn get_orientation(&mut self) -> SenseHatResult<Orientation>
[src]
pub fn get_orientation(&mut self) -> SenseHatResult<Orientation>
Returns a vector representing the current orientation, using all three sensors.
pub fn get_compass(&mut self) -> SenseHatResult<Angle>
[src]
pub fn get_compass(&mut self) -> SenseHatResult<Angle>
Get the compass heading (ignoring gyro and magnetometer)
pub fn get_gyro(&mut self) -> SenseHatResult<Orientation>
[src]
pub fn get_gyro(&mut self) -> SenseHatResult<Orientation>
Returns a vector representing the current orientation using only the gyroscope.
pub fn get_accel(&mut self) -> SenseHatResult<Orientation>
[src]
pub fn get_accel(&mut self) -> SenseHatResult<Orientation>
Returns a vector representing the current orientation using only the accelerometer.
pub fn get_accel_raw(&mut self) -> SenseHatResult<Vector3D>
[src]
pub fn get_accel_raw(&mut self) -> SenseHatResult<Vector3D>
Returns a vector representing the current acceleration in Gs.
pub fn text(
&mut self,
message: &str,
fg: Colour,
bg: Colour
) -> SenseHatResult<()>
[src]
pub fn text(
&mut self,
message: &str,
fg: Colour,
bg: Colour
) -> SenseHatResult<()>
Displays a scrolling message on the LED matrix.
Blocks until the entire message has scrolled past.
pub fn clear(&mut self) -> SenseHatResult<()>
[src]
pub fn clear(&mut self) -> SenseHatResult<()>
Clears the LED matrix