Powered Up Device

../_images/sensor_pup.png
class PUPDevice(port)

Powered Up motor or sensor.

Parameters

port (Port) – Port to which the device is connected.

info()

Returns information about the device.

Returns

Dictionary with information, such as the device id.

Return type

dict

read(mode)

Reads values from a given mode.

Parameters

mode (int) – Device mode.

Returns

Values read from the sensor.

Return type

tuple

write(mode, data)

Writes values to the sensor. Only selected sensors and modes support this.

Parameters
  • mode (int) – Device mode.

  • data (tuple) – Values to be written.