@@ -8,22 +8,22 @@ An example:
8
8
from pylgbst.hub import MoveHub, TiltSensor
9
9
import time
10
10
11
- def callback (pitch , roll , yaw ):
12
- print (" Pitch : %s / Roll : %s / Yaw: %s " % (pitch, roll , yaw))
11
+ def callback (roll , pitch , yaw ):
12
+ print (" Roll : %s / Pitch : %s / Yaw: %s " % (roll, pitch , yaw))
13
13
14
14
hub = MoveHub()
15
15
16
- hub.tilt_sensor.subscribe(callback, mode = TiltSensor.MODE_3AXIS_SIMPLE )
16
+ hub.tilt_sensor.subscribe(callback, mode = TiltSensor.MODE_3AXIS_ACCEL )
17
17
time.sleep(60 ) # turn MoveHub block in different ways
18
18
hub.tilt_sensor.unsubscribe(callback)
19
19
```
20
20
21
21
` TiltSensor ` sensor mode constants:
22
22
- ` MODE_2AXIS_SIMPLE ` - use ` callback(state) ` for 2-axis simple state detect
23
- - ` MODE_2AXIS_FULL ` - use ` callback(roll, pitch) ` for 2-axis roll&pitch degree values
23
+ - ` MODE_2AXIS_ANGLE ` - use ` callback(roll, pitch) ` for 2-axis roll&pitch degree values
24
24
- ` MODE_3AXIS_SIMPLE ` - use ` callback(state) ` for 3-axis simple state detect
25
- - ` MODE_3AXIS_FULL ` - use ` callback(roll, pitch) ` for 2 -axis roll&pitch degree values
26
- - ` MODE_BUMP_COUNT ` - use ` callback(count) ` to detect bumps
25
+ - ` MODE_3AXIS_ACCEL ` - use ` callback(roll, pitch, yaw ) ` for 3 -axis roll&pitch&yaw degree values
26
+ - ` MODE_IMPACT_COUNT ` - use ` callback(count) ` to detect bumps
27
27
28
28
There are tilt sensor constants for "simple" states, for 2-axis mode their names are also available through ` TiltSensor.DUO_STATES ` :
29
29
- ` DUO_HORIZ ` - "HORIZONTAL"
0 commit comments