Compass noise effects Nano PWM output

QMC5883L compass noise is causing PWM output to jump around. The output of the compass on pin 5 jumps around 1 or 2 degrees at random. Thats okay and expected. However, that is causing the PWM output from an analogWrite to also jump around. PWM out pins are 2,3, and 4. SDA and SCA are A4 and A5 respectively.
Any ideas as to cause and prevention would be appreciated.

That is also OK and expected. Why do you think it is a problem?

Maybe it's a problem with the code or the schematic you didn't post.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.