How to use MPU6050 6 axis accel/gyro (or any I2Cdev) with Attiny


this took me days figure out, solution simple implement.

attached zip of named "wire" library, tinywirem library few changes:
-every instance of tinywirem replaced wire
-"send" method changed "write" method
-"recieve" method changed "read" method
- added "#define buffer_length    16"

the arduino ide looks in user libraries before libraries, drop "wire" library libraries folder, , classes depend on wire should compile , function.

in examples there code read 1 gyroscope axis , print whatever serial monitor have hooked pin 3. also, have tested on attiny85 @ 8mhz using ide 1.6 on macbook pro- reply if not work or if have fix.


limitations of 'easy fix'-

-the standard 'wire' library has i2c slave capabilities - tinywirem master (but should able use tinywires alongside library)

-you need removed wire library or rename , restart arduino ide use standard wire library,  don't think atmega or arduino can use tinywire.

be looking out attiny balancing robot instructable

thank posting this!
have got running right?


Arduino Forum > Using Arduino > Programming Questions > How to use MPU6050 6 axis accel/gyro (or any I2Cdev) with Attiny


arduino

Comments