Teensy and PWM
Teensy and PWM Teensy 3.1/3.2 boards have 12 pins support PWM PWM Resolution Teensy 3.1/3.2 Boards based on 32 bit M4 arm cortex board , and the resolution of these boards higher than normal arduino boards (Like Mega and Uno) . the Teensy PWM resolution can be up to 16 bit and you can set the PWM resolution using this function analogWriteResolution(value); value: Resolution value (2 - 16 ) PWM Frequency in default , the PWM frequency for teensy 3.1/3.2 is 488 Hz and you can change it using this function: analogWriteFrequency(pin, freq); pin : PWM pin freq : Frequency in Hz Simple Code simple code here to enable PWM on teensy pins 4 and 5 , and change the frequency for pin# 4 Code : download it from here /* * PWM teensy 3.1/3.2 simple code * more information * https://mb-raw.blogspot.com/2018/02/teensy-and-pwm.html * written by : Mohannad Rawashdeh */ const int PWMpin1 = 4 ; //FTM1 timer const int PWMpin2 = 5 ; //FTM0 timer void setup ( ) { pinMod...