QUERY · ISSUE
ESP32 Read PWM-GPIO Value
enhancement
Is it possible to implement a read back of the current gpio status for a pin that is driven by the pwm module? I would need it in combination with the @micropython.viper decorator.
from machine import Pin,PWM
p0 = Pin(0, Pin.OUT)
pwm = PWM(p0, freq=100, duty=512)
print(p0.value())
CANDIDATE · ISSUE
ESP32, PWM channel issues
Seems the ESP32 use the same channel for all pwms.
>>> import machine
>>> pw1 = machine.PWM(machine.Pin(0))
>>> pw2 = machine.PWM(machine.Pin(14))
>>> print(pw1, pw2)
PWM(0, freq=5000, duty=512) PWM(14, freq=5000, duty=512)
>>> pw1.freq(1000)
>>> print(pw1, pw2)
PWM(0, freq=1000, duty=512) PWM(14, freq=1000, duty=512)
Reading the pwm code for the esp32 port, it should use instead a map of an available channel per pin.
esp32spiram-idf3-20200722-unstable-v1.12-652-gcaaaa2b1f.bin