From 04b292927c22eaa5f2a4f4313db8de0821da0303 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Wed, 17 Feb 2016 11:33:55 -0800 Subject: [PATCH] Fix mask size. --- PyMata/pymata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyMata/pymata.py b/PyMata/pymata.py index df3c84b..4bb8a73 100644 --- a/PyMata/pymata.py +++ b/PyMata/pymata.py @@ -386,7 +386,7 @@ def extended_analog(self, pin, data): @param pin: 0 - 127 @param data: 0 - 0xfffff """ - analog_data = [pin, data & 0x7f, (data >> 7) & 0x7f, (data >> 14) & 0x3fff] + analog_data = [pin, data & 0x7f, (data >> 7) & 0x7f, (data >> 14) & 0x7f] self._command_handler.send_sysex(self._command_handler.EXTENDED_ANALOG, analog_data) @@ -842,7 +842,7 @@ def stepper_step(self, motor_speed, number_of_steps): else: direction = 0 abs_number_of_steps = abs(number_of_steps) - data = [self.STEPPER_STEP, motor_speed & 0x7f, (motor_speed >> 7) & 0x7f, (motor_speed >> 14) & 0x3fff, + data = [self.STEPPER_STEP, motor_speed & 0x7f, (motor_speed >> 7) & 0x7f, (motor_speed >> 14) & 0x7f, abs_number_of_steps & 0x7f, (abs_number_of_steps >> 7) & 0x7f, direction] self._command_handler.send_sysex(self._command_handler.STEPPER_DATA, data)