# testLEDDimming with SC13048Q dev
from machine import Pin, Timer
import time
p = Pin('PA8') # PA8 has TIM1, CH1
tim = machine.Timer(1, freq=4000)
ch = tim.channel(1, Timer.PWM, pin=p)
ch.pulse_width_percent(50)
for d in range(100, 0.1):
ch.pulse_width_percent(d)
time.sleep(0.01)
Error on line: tim = machine.Timer(1, freq=4000)
Error message:
Traceback (most recent call last):
File "", line 1, in
ValueError: Timer doesn't exist
I tried with and without machine in front of Timer but nothing. Timer seems implemented because in Thonny autocompletion shows Timer.
With microPython 0.2:
Error on line:
tim = machine.Timer(1, freq=4000)
Error message: Traceback (most recent call last): File "", line 1, in
ValueError: Timer doesn't exist
I tried with and without machine in front of Timer but nothing. Timer seems implemented because in Thonny autocompletion shows Timer.