Skip to content

Commit

Permalink
pybricks.pupdevices.UltrasonicSensor: remove power hack
Browse files Browse the repository at this point in the history
Sensors that require power are now automatically powered when plugged in, so we no longer need this hack at the module level.
  • Loading branch information
laurensvalk committed Dec 23, 2020
1 parent fccd9b5 commit 64620ca
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pybricks/pupdevices/pb_type_pupdevices_ultrasonicsensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ STATIC mp_obj_t pupdevices_UltrasonicSensor_make_new(const mp_obj_type_t *type,
// Get iodevices
self->pbdev = pb_device_get_device(port, PBIO_IODEV_TYPE_ID_SPIKE_ULTRASONIC_SENSOR);

// This sensor requires power, which iodevice does not do automatically yet
pb_device_set_power_supply(self->pbdev, 100);

// Create an instance of the LightArray class
self->lights = common_LightArray_obj_make_new(self->pbdev, PBIO_IODEV_MODE_PUP_ULTRASONIC_SENSOR__LIGHT, 4);

Expand Down

0 comments on commit 64620ca

Please sign in to comment.