toio.simple package¶
Submodules¶
- toio.simple.async_simple module
DirectionAsyncSimpleCubeAsyncSimpleCube.DEFAULT_ROTATION_OPTIONAsyncSimpleCube.DEFAULT_MOVEMENT_TYPEAsyncSimpleCube.DEFAULT_TIMEOUTAsyncSimpleCube.DEFAULT_ONE_STEPAsyncSimpleCube.CELL_SIZEAsyncSimpleCube.MONITORING_CYCLEAsyncSimpleCube.ensure_event_loop()AsyncSimpleCube.search()AsyncSimpleCube.__init__()AsyncSimpleCube.connect()AsyncSimpleCube.disconnect()AsyncSimpleCube.sleep()AsyncSimpleCube.move()AsyncSimpleCube.spin()AsyncSimpleCube.run_motor()AsyncSimpleCube.stop_motor()AsyncSimpleCube.move_steps()AsyncSimpleCube.turn()AsyncSimpleCube.move_to()AsyncSimpleCube.set_orientation()AsyncSimpleCube.move_to_the_grid_cell()AsyncSimpleCube.get_current_position()AsyncSimpleCube.get_x()AsyncSimpleCube.get_y()AsyncSimpleCube.get_orientation()AsyncSimpleCube.get_grid()AsyncSimpleCube.get_grid_x()AsyncSimpleCube.get_grid_y()AsyncSimpleCube.is_on_the_gird_cell()AsyncSimpleCube.is_touched()AsyncSimpleCube.get_touched_card()AsyncSimpleCube.get_cube_name()AsyncSimpleCube.get_battery_level()AsyncSimpleCube.get_3d_angle()AsyncSimpleCube.get_posture()AsyncSimpleCube.is_button_pressed()AsyncSimpleCube.turn_on_cube_lamp()AsyncSimpleCube.turn_on_smooth_flashing()AsyncSimpleCube.turn_off_cube_lamp()AsyncSimpleCube.play_sound()AsyncSimpleCube.stop_sound()AsyncSimpleCube.is_magnet_in_contact()AsyncSimpleCube.request_remote_power_off()AsyncSimpleCube.set_speaker_mute()AsyncSimpleCube.reset_configuration()
Module contents¶
- 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:
objectAccess to toio core cube by easier method Functions that like blocks in visual programming
- __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]¶
- run_motor(left_speed: int, right_speed: int, duration: float, wait_to_complete: bool = True) None[source]¶
- is_touched(item: StandardIdCard) bool[source]¶
- turn_on_smooth_flashing(r: int, g: int, b: int, repeat: int, cycle: float) None[source]¶
turn_on_smooth_flashing.
- Parameters:
r (int) – Red (0-255)
g (int) – Green (0-255)
b (int) – Blue (0-255)
repeat (int) – Number of repetitions (0: infinite)
cycle (float) – Cycle of flashing [s]
- Return type:
None
- request_remote_power_off(time_s: int) None[source]¶
request_remote_power_off.
- Parameters:
time_s (int) – Time until power off [s]
- Return type:
None
- set_speaker_mute(mute: SpeakerMute) None[source]¶
set_speaker_mute.
- Parameters:
mute (SpeakerMute) – Mute setting
- Return type:
None
- class toio.simple.AsyncSimpleCube(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, cube: ~toio.cube.ToioCoreCube | None = None)[source]¶
Bases:
objectAccess 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¶
- __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, cube: ~toio.cube.ToioCoreCube | None = None) None[source]¶
- async spin(speed: int, duration: float, wait_to_complete: bool = True) None[source]¶
speed: (negative value: anticlockwise)
- async run_motor(left_speed: int, right_speed: int, duration: float, wait_to_complete: bool = True) None[source]¶
- async is_touched(item: StandardIdCard) bool[source]¶
- async turn_on_smooth_flashing(r: int, g: int, b: int, repeat: int, cycle: float) None[source]¶
turn_on_smooth_flashing.
- Parameters:
r (int) – Red (0-255)
g (int) – Green (0-255)
b (int) – Blue (0-255)
repeat (int) – Number of repetitions (0: infinite)
cycle (float) – Cycle of flashing [s]
- Return type:
None
- async request_remote_power_off(time_s: int) None[source]¶
request_remote_power_off.
- Parameters:
time_s (int) – Time until power off [s]
- Return type:
None
- async set_speaker_mute(mute: SpeakerMute) None[source]¶
set_speaker_mute.
- Parameters:
mute (SpeakerMute) – Mute setting
- Return type:
None
- class toio.simple.SimpleCube_v1_0(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, dbg_name: str = '')[source]¶
Bases:
objectAccess 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¶
- __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, dbg_name: str = '') 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]¶
- is_touched(item: StandardIdCard) bool[source]¶
- turn_on_smooth_flashing(r: int, g: int, b: int, repeat: int, cycle: float) None[source]¶
turn_on_smooth_flashing.
- Parameters:
r (int) – Red (0-255)
g (int) – Green (0-255)
b (int) – Blue (0-255)
repeat (int) – Number of repetitions (0: infinite)
cycle (float) – Cycle of flashing [s]
- Return type:
None
- request_remote_power_off(time_s: int) None[source]¶
request_remote_power_off.
- Parameters:
time_s (int) – Time until power off [s]
- Return type:
None
- set_speaker_mute(mute: SpeakerMute) None[source]¶
set_speaker_mute.
- Parameters:
mute (SpeakerMute) – Mute setting
- Return type:
None