Yes but you are wrong about that.
Take this simple code:-
void setup() {
analogWrite(11, 255);
}
void loop() {
}
This is the waveform it produces on an oscilloscope:-
Do you see any form of toggling
at all?
The answer is no, it doesn't toggle.
If you change the code to:-
void setup() {
analogWrite(11, 128);
}
void loop() {
}
Then you see this, look it is toggling.
So to claim the output toggles with a value of 255 IS 100% WRONG
theboot
22
But when you set it to 255, how does it get to 255, it toggles to 255 
But yes a poor choice of words for 255.
Lets say 254 then it will toggle on and off with a duty cycle of 99.6%
asaroli
23
After reading these answers it seems like most people agree it is just the sound of the PWM as the humming disappears when i disconnect the motors
asaroli
24
and now that I think about it the humming only started when i added the pwm feature
"What shall we do with the ........."
theboot
27
So change the frequency of the pwm pins to a higher frequency. See this link
https://domoticx.com/arduino-pwm-frequency-and-timers/
system
Closed
29
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.