Skip to content

Commit

Permalink
Merge pull request #18 from ladyada/master
Browse files Browse the repository at this point in the history
Raspi/CPython compatibility
  • Loading branch information
tannewt committed Aug 30, 2018
2 parents abf7ad2 + ee2ddbf commit a2c3896
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adafruit_seesaw/seesaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def analog_write(self, pin, value):
if self.pin_mapping.pwm_width == 16:
if pin in self.pin_mapping.pwm_pins:
pin_found = True
cmd = bytearray([self.pin_mapping.pwm_pins.index(pin), (value >> 8), value])
cmd = bytearray([self.pin_mapping.pwm_pins.index(pin), (value >> 8), value & 0xFF])
else:
if pin in self.pin_mapping.pwm_pins:
pin_found = True
Expand All @@ -303,7 +303,7 @@ def analog_write(self, pin, value):

def set_pwm_freq(self, pin, freq):
if pin in self.pin_mapping.pwm_pins:
cmd = bytearray([self.pin_mapping.pwm_pins.index(pin), (freq >> 8), freq])
cmd = bytearray([self.pin_mapping.pwm_pins.index(pin), (freq >> 8), freq & 0xFF])
self.write(_TIMER_BASE, _TIMER_FREQ, cmd)
else:
raise ValueError("Invalid PWM pin")
Expand Down

0 comments on commit a2c3896

Please sign in to comment.