Skip to content

Commit ff7c32b

Browse files
authored
Merge pull request #96 from elias-lange/update_documentation
Updated documentation of tilt sensor.
2 parents c88902a + fbbf89d commit ff7c32b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/TiltSensor.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ An example:
88
from pylgbst.hub import MoveHub, TiltSensor
99
import time
1010

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))
1313

1414
hub = MoveHub()
1515

16-
hub.tilt_sensor.subscribe(callback, mode=TiltSensor.MODE_3AXIS_SIMPLE)
16+
hub.tilt_sensor.subscribe(callback, mode=TiltSensor.MODE_3AXIS_ACCEL)
1717
time.sleep(60) # turn MoveHub block in different ways
1818
hub.tilt_sensor.unsubscribe(callback)
1919
```
2020

2121
`TiltSensor` sensor mode constants:
2222
- `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
2424
- `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
2727

2828
There are tilt sensor constants for "simple" states, for 2-axis mode their names are also available through `TiltSensor.DUO_STATES`:
2929
- `DUO_HORIZ` - "HORIZONTAL"

0 commit comments

Comments
 (0)