From 03af055b56f29389f26be30727aad7779716f1d3 Mon Sep 17 00:00:00 2001 From: ghecko Date: Thu, 7 Jan 2021 17:01:18 +0100 Subject: [PATCH] Change allowed PWM frequency --- CHANGELOG.md | 16 ++++++++++++++++ octowire/pwm.py | 6 +++--- setup.py | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e55a7..9ba0408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. +## [1.0.5] - 2020-01-07 + +### Added + +### Changed + +- Update allowed PWM frequency + +## [1.0.4] - 2020-10-16 + +### Added + +### Changed + +- Fixed typo in install_requires + ## [1.0.3] - 2020-10-16 ### Added diff --git a/octowire/pwm.py b/octowire/pwm.py index dc79406..6223dd3 100644 --- a/octowire/pwm.py +++ b/octowire/pwm.py @@ -41,12 +41,12 @@ def __init__(self, serial_instance, pwm_pin): def set(self, frequency=1000000, duty_cycle=500): """ Set the PWM. - :param frequency: PWM frequency (2Hz to 100MHz). + :param frequency: PWM frequency (0Hz to 60MHz). :param duty_cycle: Duty cycle in per mille (0 to 1000‰). :return: 6 Bytes (4 bytes for effective frequency + 2 bytes for effective duty cycle). """ - if frequency not in range(2, 100000000): - raise ValueError('PWM frequency should be defined between 2 and 100 000 000 (0Hz to 100MHz)') + if frequency not in range(0, 60000000): + raise ValueError('PWM frequency should be defined between 0 and 60 000 000 (0Hz to 60MHz)') if duty_cycle not in range(0, 1000): raise ValueError('PWM duty cycle should be defined between 0 and 1000 per mille') frequency = struct.pack("