Skip to content

Can't use Timer #19

Description

@bauland

With microPython 0.2:

# 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions