Jump to content
I2Cdevlib Forums

Arduino Leonardo + MPU6050 ( i2cdevlib ) + Servo.h ( 2 Servos) = messed up PWM


Recommended Posts

Guys, please help to understand something:

Im trying to get data from i2cdevlib running MPU6050 to control servos, but strange stuff happening, it seems like when i2cdevlib library start getting data from Sensor my PWM signals  are totally messed up....
I using pins 10, 11 on Leonardo.

In same time  my other very simple MPU6050 test  code (whcih uses only Wire and Servo) with plain calculation works ok, ( but signals from sensor and not as nice and smooth  as from i2cdevlib )

Is it possible that i2cdevlib for MPU6050 prevent Servo library/PWM from work properly ?

Link to comment
Share on other sites

  • 3 weeks later...

I'm not an expert, but as far as I see it has something to do with timers. Servo uses timer1,.. is it possible that i2cdevlib uses it too? If so, I am going to have the same problem.

 

Another thin would be interrupts. So that something in i2c lib interrupts during stuff in servo or so,.. but this is probably just paranoia, because I had so much trouble with that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...