I seem to have found a small bug in analogWriteFrequency. While working on my eGocart project I managed to do this.
It looks harmless but boy did it kill my afternoon.
I was trying to set pin 25 High with a switch and a few other variables and it would sometimes go on and off quickly and other times do nothing. After banging my head on my Keyboard for a few hours trying to figure out why my If statement was broken I started disabling huge chunks of code. 900lines later...... I commented out the above code and pin 25 started working......
It seems that if you write to the same timer twice it borks something, even though pin25 is on a different timer and was not being used for PWM it was pulsing the pin one time instead of holding it High.
Well I have just enough time left in the day to get drunk and go to bed so later everyone.
Code:
analogWriteFrequency(22, PWMfrequency);
analogWriteFrequency(23, PWMfrequency);
It looks harmless but boy did it kill my afternoon.
I was trying to set pin 25 High with a switch and a few other variables and it would sometimes go on and off quickly and other times do nothing. After banging my head on my Keyboard for a few hours trying to figure out why my If statement was broken I started disabling huge chunks of code. 900lines later...... I commented out the above code and pin 25 started working......
It seems that if you write to the same timer twice it borks something, even though pin25 is on a different timer and was not being used for PWM it was pulsing the pin one time instead of holding it High.
Well I have just enough time left in the day to get drunk and go to bed so later everyone.