toio.simple package

class toio.simple.Direction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Forward = 1
Backward = 2
Right = 3
Left = 4
class toio.simple.SimpleCube(name: str | None = None, timeout: int = 5, coordinate_system_class: ~typing.Type[~toio.coordinate_systems.ToioRelativeCoordinateSystem | ~toio.coordinate_systems.VisualProgrammingCoordinateSystem] = <class 'toio.coordinate_systems.VisualProgrammingCoordinateSystem'>, log_level: int = 0)[source]

Bases: object

Access to toio core cube by easier method Functions that like blocks in visual programming

DEFAULT_ROTATION_OPTION: ClassVar[RotationOption] = 0
DEFAULT_MOVEMENT_TYPE: ClassVar[MovementType] = 0
DEFAULT_TIMEOUT: ClassVar[int] = 10
DEFAULT_ONE_STEP: ClassVar[int] = 1
CELL_SIZE: ClassVar[float] = 43.43
MONITORING_CYCLE: ClassVar[float] = 0.01
async classmethod search(name: str | None = None, timeout: int = 5) ToioCoreCube[source]
__init__(name: str | None = None, timeout: int = 5, coordinate_system_class: ~typing.Type[~toio.coordinate_systems.ToioRelativeCoordinateSystem | ~toio.coordinate_systems.VisualProgrammingCoordinateSystem] = <class 'toio.coordinate_systems.VisualProgrammingCoordinateSystem'>, log_level: int = 0) None[source]
disconnect()[source]
sleep(sleep_second: float)[source]
move(speed: int, duration: float, wait_to_complete: bool = True) None[source]
spin(speed: int, duration: float, wait_to_complete: bool = True) None[source]

speed: (negative value: anticlockwise)

run_motor(left_speed: int, right_speed: int, duration: float, wait_to_complete: bool = True) None[source]
stop_motor() None[source]
move_steps(direction: Direction, speed: int, step: int) bool[source]
turn(speed: int, degree: int) bool[source]
move_to(speed: int, x: int, y: int) bool[source]
set_orientation(speed: int, degree: int) bool[source]
move_to_the_grid_cell(speed: int, cell_x: int, cell_y: int) bool[source]
get_current_position() tuple[int, int] | None[source]
get_x() int | None[source]
get_y() int | None[source]
get_orientation() int | None[source]
get_grid() tuple[int, int] | None[source]
get_grid_x() int | None[source]
get_grid_y() int | None[source]
is_on_the_gird_cell(cell_x: int, cell_y: int) bool[source]
is_touched(item: StandardIdCard) bool[source]
get_touched_card() int | None[source]
get_cube_name() str | None[source]
get_battery_level() int | None[source]
get_3d_angle() tuple[int, int, int] | None[source]
get_posture() int | None[source]
is_button_pressed() int | None[source]
turn_on_cube_lamp(r: int, g: int, b: int, duration: float) None[source]
turn_off_cube_lamp() None[source]
play_sound(note: int, duration: float, wait_to_complete: bool = True) bool[source]
stop_sound() None[source]
is_magnet_in_contact() int | None[source]