Skip to content

Commit 074a09d

Browse files
author
Thomas Preston
committed
Fixed set_bulk for servos
1 parent 650d208 commit 074a09d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codebug_tether/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def pwm_freq(self, frequency):
215215
pass
216216

217217
def pwm_off(self):
218+
"""Turns off the PWM generator."""
218219
go_busy_off_mask = 0xff ^ (1 << 4)
219220
self.and_mask(CHANNEL_INDEX_PWM_CONF_2, go_busy_off_mask)
220221

@@ -224,9 +225,9 @@ def servo_set(self, servo_index, pulse_length):
224225
conf_msb = ((servo_index & 0xf) << 4) | 0x01
225226
conf_lsb = ((servo_index & 0xf) << 4) | 0x00
226227
self.set_bulk(CHANNEL_INDEX_SERVO_PULSE_LENGTH,
227-
[pulse_length_msb, conf_msb])
228+
bytes([pulse_length_msb, conf_msb]))
228229
self.set_bulk(CHANNEL_INDEX_SERVO_PULSE_LENGTH,
229-
[pulse_length_lsb, conf_lsb])
230+
bytes([pulse_length_lsb, conf_lsb]))
230231

231232
def clear(self):
232233
"""Clears the pixels on CodeBug.

0 commit comments

Comments
 (0)