diff options
| author | robert-hh <robert@hammelrath.com> | 2024-11-04 16:04:56 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-11-18 16:05:56 +1100 |
| commit | 898407defbb6327fde379304846999033bf349c5 (patch) | |
| tree | 37a80eb19a64b85a1ca823598816bbaea5764bb2 /docs/samd | |
| parent | 5dc9eda1953668eb6861be01ca85f147dcf8d406 (diff) | |
ports: Make PWM duty_u16 have an upper value of 65535 across all ports.
The following ports used 65536 as the upper value (100% duty cycle) and are
changed in this commit to use 65535: esp8266, mimxrt, nrf, samd.
Tested that output is high at `duty_u16(65535)` and low at `duty_u16(0)`.
Also verified that at `duty_u16(32768)` the high and low pulse have the
same length.
Partially reverts #10850, commits 9c7ad68165bcd224c94ca6d8f172362cf8000d99
and 2ac643c15bec8c88ece0e944ce58f36d02dfd2dd.
Signed-off-by: robert-hh <robert@hammelrath.com>
Diffstat (limited to 'docs/samd')
| -rw-r--r-- | docs/samd/quickref.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/samd/quickref.rst b/docs/samd/quickref.rst index 25b5a8fc8..d57dc6790 100644 --- a/docs/samd/quickref.rst +++ b/docs/samd/quickref.rst @@ -215,7 +215,7 @@ PWM Constructor - *freq* should be an integer which sets the frequency in Hz for the PWM cycle. The valid frequency range is 1 Hz to 24 MHz. - - *duty_u16* sets the duty cycle as a ratio ``duty_u16 / 65536``. + - *duty_u16* sets the duty cycle as a ratio ``duty_u16 / 65535``. - *duty_ns* sets the pulse width in nanoseconds. The limitation for X channels apply as well. - *invert*\=True|False. Setting a bit inverts the respective output. @@ -246,7 +246,7 @@ Use the :ref:`machine.ADC <machine.ADC>` class:: from machine import ADC adc0 = ADC(Pin('A0')) # create ADC object on ADC pin, average=16 - adc0.read_u16() # read value, 0-65536 across voltage range 0.0v - 3.3v + adc0.read_u16() # read value, 0-65535 across voltage range 0.0v - 3.3v adc1 = ADC(Pin('A1'), average=1) # create ADC object on ADC pin, average=1 The resolution of the ADC is 12 bit with 12 bit accuracy, irrespective of the |
