File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change 9
9
sox .accelerometer_range = AccelRange .RANGE_16G
10
10
print ("Accelerometer range set to: %d G" % AccelRange .string [sox .accelerometer_range ])
11
11
12
- for accel_range in [AccelRange .RANGE_2G , AccelRange .RANGE_4G ,
13
- AccelRange .RANGE_8G , AccelRange .RANGE_16G ]:
14
-
15
- sox .accelerometer_range = accel_range
16
- print ("Gravity is %.2f ms^2 when accelerometer range is %d G" %
17
- (sox .acceleration [2 ], AccelRange .string [sox .accelerometer_range ]))
18
-
19
- print ()
20
12
sox .gyro_range = GyroRange .RANGE_500_DPS
21
13
print ("Gyro range set to: %d DPS" % GyroRange .string [sox .gyro_range ])
22
- for gyro_range in [GyroRange .RANGE_250_DPS , GyroRange .RANGE_500_DPS ,
23
- GyroRange .RANGE_1000_DPS , GyroRange .RANGE_2000_DPS ]:
24
14
25
- sox .gyro_range = gyro_range
26
- print ("Non movement is %.2f degrees/s when gyro range is %d DPS" %
27
- (sox .gyro [2 ], GyroRange .string [sox .gyro_range ]))
28
- print ()
29
15
sox .accelerometer_rate = Rate .RATE_12_5_HZ
30
16
print ("Accelerometer rate set to: %d HZ" % Rate .string [sox .accelerometer_rate ])
31
17
32
18
sox .gyro_rate = Rate .RATE_12_5_HZ
33
19
print ("Gyro rate set to: %d HZ" % Rate .string [sox .gyro_rate ])
34
20
35
- print ()
36
21
while True :
37
22
print ("Accel X:%.2f Y:%.2f Z:%.2f ms^2 Gyro X:%.2f Y:%.2f Z:%.2f degrees/s" %
38
23
(sox .acceleration + sox .gyro ))
You can’t perform that action at this time.
0 commit comments