Skip to main content

get_orientation_message()

Description#

Uses the acceleration values to find Zumi's orientation with respect to the strongest force being applied to Zumi (gravity). This function returns the orientation as a String.

Syntax#

get_orientation_message()

Parameters#

None

Returns#

String: a description of the orientation state

Orientation state
"unknown"
"face up"
"face down"
"right side down"
"left side down"
"upright"
"upside down"
"accelerating"

Example Code#
Python#
#Python code
from zumi.zumi import Zumi
import time
zumi = Zumi()
#grab zumi and place it on any side
#example: upside down, on its nose etc.
for i in range(20):
orientation = zumi.get_orientation_message()
print(orientation)
time.sleep(0.5)
print(" done ")