@@ -4,45 +4,39 @@ use sensehat::SenseHat;
44
55fn main ( ) {
66 let mut sense_hat = SenseHat :: new ( ) . expect ( "Couldn't create Sense Hat object" ) ;
7- let temp = sense_hat. get_temperature_from_humidity ( ) . expect (
8- "Couldn't get temp" ,
9- ) ;
7+ let temp = sense_hat
8+ . get_temperature_from_humidity ( )
9+ . expect ( "Couldn't get temp" ) ;
1010 println ! ( "It's {} on the humidity sensor" , temp) ;
11- let temp = sense_hat. get_temperature_from_pressure ( ) . expect (
12- "Couldn't get temp" ,
13- ) ;
11+ let temp = sense_hat
12+ . get_temperature_from_pressure ( )
13+ . expect ( "Couldn't get temp" ) ;
1414 println ! ( "It's {} on the pressure sensor" , temp) ;
1515 let rh = sense_hat. get_humidity ( ) . expect ( "Couldn't get rh" ) ;
1616 println ! ( "It's {} relative humidity" , rh) ;
1717 let pressure = sense_hat. get_pressure ( ) . expect ( "Couldn't get pressure" ) ;
1818 println ! ( "The pressure is {}" , pressure) ;
1919 loop {
20- let orientation = sense_hat. get_orientation ( ) . expect (
21- "Couldn't get orientation" ,
22- ) ;
20+ let orientation = sense_hat
21+ . get_orientation ( )
22+ . expect ( "Couldn't get orientation" ) ;
2323 println ! (
2424 "Fusion orientation: {}, {}, {}" ,
25- orientation. roll,
26- orientation. pitch,
27- orientation. yaw
25+ orientation. roll, orientation. pitch, orientation. yaw
2826 ) ;
2927 if let Ok ( heading) = sense_hat. get_compass ( ) {
3028 println ! ( "Compass heading : {}" , heading) ;
3129 }
3230 if let Ok ( orientation) = sense_hat. get_gyro ( ) {
3331 println ! (
3432 "Gyro orientation : {}, {}, {}" ,
35- orientation. roll,
36- orientation. pitch,
37- orientation. yaw
33+ orientation. roll, orientation. pitch, orientation. yaw
3834 ) ;
3935 }
4036 if let Ok ( orientation) = sense_hat. get_accel ( ) {
4137 println ! (
4238 "Accel orientation: {}, {}, {}" ,
43- orientation. roll,
44- orientation. pitch,
45- orientation. yaw
39+ orientation. roll, orientation. pitch, orientation. yaw
4640 ) ;
4741 }
4842 :: std:: thread:: sleep ( :: std:: time:: Duration :: from_millis ( 250 ) ) ;
0 commit comments