Hello,
I'm working on a project which involves flashing 3 LEDs at different, precisely defined frequencies, and with different duty cycles.
It is my understanding that Teensy 3.1 has 3 timers (0, 1 and 2) which means I can indeed achieve PWM signals with 3 different frequencies, using analogWriteFrequency(pin, frequency) - this allows setting precise frequency, not just integer multiple of base frequency, correct?
However I also need to control 2 motors (most likely using PWM) and probably will also need to use timer-sensitive functions such as millis()
It probably doesn't matter too much if the motor driving PWM frequency changes as long as it's still reasonably high, but not ideal.
is there some way I can have all these things working together without causing issues? Possibly use some manual approach to Motor speed control or LED flash frequency, to leave a timer intact for millis() etc?
Is there another timer I'm missing which could help?
The LED PWM frequency would be in range 10Hz - 1kHz
Thanks for any advice!
I'm working on a project which involves flashing 3 LEDs at different, precisely defined frequencies, and with different duty cycles.
It is my understanding that Teensy 3.1 has 3 timers (0, 1 and 2) which means I can indeed achieve PWM signals with 3 different frequencies, using analogWriteFrequency(pin, frequency) - this allows setting precise frequency, not just integer multiple of base frequency, correct?
However I also need to control 2 motors (most likely using PWM) and probably will also need to use timer-sensitive functions such as millis()
It probably doesn't matter too much if the motor driving PWM frequency changes as long as it's still reasonably high, but not ideal.
is there some way I can have all these things working together without causing issues? Possibly use some manual approach to Motor speed control or LED flash frequency, to leave a timer intact for millis() etc?
Is there another timer I'm missing which could help?
The LED PWM frequency would be in range 10Hz - 1kHz
Thanks for any advice!
Last edited: