File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,6 @@ the Earth with an acceleration of `1 g` but from its point of view the board is
65
65
actually moving upwards (away from the center of the Earth) with an acceleration
66
66
of ` 1 g ` . And that's why the proper acceleration is pointing up. This also means
67
67
that if the board was in free fall, the accelerometer would report a "proper"
68
- acceleration of zero. Please, don't try that home.
68
+ acceleration of zero. Please, don't try that at home.
69
69
70
70
Yes, physics is hard. Let's move on.
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ use pg::{delay, lsm303dlhc};
12
12
#[ no_mangle]
13
13
pub fn main ( ) -> ! {
14
14
loop {
15
- const FACTOR : f32 = 8. / ( ( 1 << 15 ) as f32 ) ;
15
+ const SENSITIVITY : f32 = 8. / ( ( 1 << 15 ) as f32 ) ;
16
16
17
17
let I16x3 { x, y, z } = lsm303dlhc:: acceleration ( ) ;
18
18
19
- let x = f32:: from ( x) * FACTOR ;
20
- let y = f32:: from ( y) * FACTOR ;
21
- let z = f32:: from ( z) * FACTOR ;
19
+ let x = f32:: from ( x) * SENSITIVITY ;
20
+ let y = f32:: from ( y) * SENSITIVITY ;
21
+ let z = f32:: from ( z) * SENSITIVITY ;
22
22
23
23
iprintln ! ( "{:?}" , ( x, y, z) ) ;
24
24
You can’t perform that action at this time.
0 commit comments