Hello, I'm using PWM_DynamicFreq.ino for generating 2 different frequency, What I'm trying to do is changing the delay between them around 1 to 10 ms.
I tried to do it with simple delay but it's not working for me. Can someone give any example for it?
Buy the way I'm using Teensy4.1
"
void loop()
{
delay(1000);
frequency = 20000.0f;
Serial.print(F("Change PWM Freq to "));
Serial.println(frequency);
PWM_Instance->setPWM(pinToUse, frequency, 20.0f);
printPWMInfo(PWM_Instance);
delay(1000);
frequency = 1000.0f;
Serial.print(F("Change PWM Freq to "));
Serial.println(frequency);
PWM_Instance->setPWM(pinToUse, frequency, 50.0f);
printPWMInfo(PWM_Instance);
}"
I tried to do it with simple delay but it's not working for me. Can someone give any example for it?
Buy the way I'm using Teensy4.1
"
void loop()
{
delay(1000);
frequency = 20000.0f;
Serial.print(F("Change PWM Freq to "));
Serial.println(frequency);
PWM_Instance->setPWM(pinToUse, frequency, 20.0f);
printPWMInfo(PWM_Instance);
delay(1000);
frequency = 1000.0f;
Serial.print(F("Change PWM Freq to "));
Serial.println(frequency);
PWM_Instance->setPWM(pinToUse, frequency, 50.0f);
printPWMInfo(PWM_Instance);
}"