modi_plus.module.input_module package

Submodules

modi_plus.module.input_module.button module

Button module.

class modi_plus.module.input_module.button.Button(id_, uuid, connection_task)[source]

Bases: InputModule

PROPERTY_BUTTON_STATE = 2
PROPERTY_OFFSET_CLICKED = 0
PROPERTY_OFFSET_DOUBLE_CLICKED = 2
PROPERTY_OFFSET_PRESSED = 4
PROPERTY_OFFSET_TOGGLED = 6
STATE_FALSE = 0
STATE_TRUE = 100
property clicked: bool

Returns true when button is clicked

Returns:

True if clicked or False.

Return type:

bool

property double_clicked: bool

Returns true when button is double clicked

Returns:

True if double clicked or False.

Return type:

bool

property pressed: bool

Returns true while button is pressed

Returns:

True if pressed or False.

Return type:

bool

property toggled: bool

Returns true when button is toggled

Returns:

True if toggled or False.

Return type:

bool

modi_plus.module.input_module.dial module

Dial module.

class modi_plus.module.input_module.dial.Dial(id_, uuid, connection_task)[source]

Bases: InputModule

PROPERTY_DIAL_STATE = 2
PROPERTY_OFFSET_SPEED = 2
PROPERTY_OFFSET_TURN = 0
property speed: int

Returns the turn speed of the dial between -100 and 100

Returns:

The dial’s turn speed.

Return type:

int

property turn: int

Returns the angle of the dial between 0 and 100

Returns:

The dial’s angle.

Return type:

int

modi_plus.module.input_module.env module

Env module.

class modi_plus.module.input_module.env.Env(id_, uuid, connection_task)[source]

Bases: InputModule

PROPERTY_ENV_STATE = 2
PROPERTY_OFFSET_HUMIDITY = 4
PROPERTY_OFFSET_ILLUMINANCE = 0
PROPERTY_OFFSET_TEMPERATURE = 2
PROPERTY_OFFSET_VOLUME = 6
property humidity: int

Returns the value of humidity between 0 and 100

Returns:

The environment’s humidity.

Return type:

int

property illuminance: int

Returns the value of illuminance between 0 and 100

Returns:

The environment’s illuminance.

Return type:

int

property temperature: int

Returns the value of temperature between -10 and 60

Returns:

The environment’s temperature.

Return type:

int

property volume: int

Returns the value of volume between 0 and 100

Returns:

The environment’s volume.

Return type:

int

modi_plus.module.input_module.imu module

Imu module.

class modi_plus.module.input_module.imu.Imu(id_, uuid, connection_task)[source]

Bases: InputModule

PROPERTY_ACC_STATE = 3
PROPERTY_ANGLE_STATE = 2
PROPERTY_GYRO_STATE = 4
PROPERTY_OFFSET_ACC_X = 0
PROPERTY_OFFSET_ACC_Y = 4
PROPERTY_OFFSET_ACC_Z = 8
PROPERTY_OFFSET_GYRO_X = 0
PROPERTY_OFFSET_GYRO_Y = 4
PROPERTY_OFFSET_GYRO_Z = 8
PROPERTY_OFFSET_PITCH = 4
PROPERTY_OFFSET_ROLL = 0
PROPERTY_OFFSET_VIBRATION = 0
PROPERTY_OFFSET_YAW = 8
PROPERTY_VIBRATION_STATE = 5
property acceleration: Tuple[float, float, float]

Returns the acceleration about x, y and z axis

Returns:

The imu’s acceleration the about x, y and z axis.

Return type:

tuple

property acceleration_x: float

Returns the x component of the acceleration

Returns:

The imu’s x-axis acceleration.

Return type:

float

property acceleration_y: float

Returns the y component of the acceleration

Returns:

The imu’s y-axis acceleration.

Return type:

float

property acceleration_z: float

Returns the z component of the acceleration

Returns:

The imu’s z-axis acceleration.

Return type:

float

property angle: Tuple[float, float, float]

Returns the angle_x, angle_y and angle_z angle of the imu

Returns:

The imu’s angles of angle_x, angle_y and angle_z.

Return type:

tuple

property angle_x: float

Returns the angle_x angle of the imu

Returns:

The imu’s angle_x angle.

Return type:

float

property angle_y: float

Returns the angle_y angle of the imu

Returns:

The imu’s angle_y angle.

Return type:

float

property angle_z: float

Returns the angle_zle_z angle of the imu

Returns:

The imu’s angle_z angle.

Return type:

float

property angular_vel_x: float

Returns the angle_x angle of the imu

Returns:

The imu’s angular velocity the about x-axis.

Return type:

float

property angular_vel_y: float

Returns the angular velocity about y-axis

Returns:

The imu’s angular velocity the about y-axis.

Return type:

float

property angular_vel_z: float

Returns the angular velocity about z-axis

Returns:

The imu’s angular velocity the about z-axis.

Return type:

float

property angular_velocity: Tuple[float, float, float]

Returns the angular velocity about x, y and z axis

Returns:

The imu’s angular velocity the about x, y and z axis.

Return type:

tuple

property vibration: float

Returns the vibration value

Returns:

The imu’s vibration.

Return type:

float

modi_plus.module.input_module.joystick module

Joystick module.

class modi_plus.module.input_module.joystick.Joystick(id_, uuid, connection_task)[source]

Bases: InputModule

PROPERTY_DIRECTION_STATE = 3
PROPERTY_OFFSET_DIRECTION = 0
PROPERTY_OFFSET_X = 0
PROPERTY_OFFSET_Y = 2
PROPERTY_POSITION_STATE = 2
STATE_DOWN = -100
STATE_LEFT = -50
STATE_ORIGIN = 0
STATE_RIGHT = 50
STATE_UP = 100
property direction: str

Returns the direction of the joystick

Returns:

‘up’, ‘down’, ‘left’, ‘right’, ‘origin’

Return type:

str

property x: int

Returns the x position of the joystick between -100 and 100

Returns:

The joystick’s x position.

Return type:

int

property y: int

Returns the y position of the joystick between -100 and 100

Returns:

The joystick’s y position.

Return type:

int

modi_plus.module.input_module.tof module

Tof module.

class modi_plus.module.input_module.tof.Tof(id_, uuid, connection_task)[source]

Bases: InputModule

PROPERTY_DISTANCE_STATE = 2
PROPERTY_OFFSET_DISTANCE = 0
property distance: float

Returns the distance of the object between 0cm and 100cm

Returns:

The tof’s distance to object.

Return type:

float

Module contents