mprograms / QMC5883LCompass

QMC5883L Compass is a Arduino library for using QMC5583L series chip boards as a compass. Supports: - Getting values of XYZ axis. - Calculating Azimuth. - Getting 16 point Azimuth bearing direction (0 - 15). - Getting 16 point Azimuth bearing Names (N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW) - Smoothing of XYZ readings via rolling averaging and min / max removal. - Optional chipset modes
GNU General Public License v3.0
105 stars 40 forks source link

QMC5883 library to Attiny85 #1

Closed Ulissesp closed 4 years ago

Ulissesp commented 5 years ago

Since the wire.h library dont work with Attiny85, we need to use TinyWireM lib. What do I need to change at QMC5883 library to wok with Attiny85? Could you help me? Thank you.

mprograms commented 4 years ago

QMC5883L Compass Library uses wire.h for its I2C communications. As you noted, the ATTiny85 does not have this support. I am not 100% familiar with the inner workings of the TinyWireM Library nor do I have a ATTiny85 laying around to test. However, if the functions of Wire and TinyWireM are the same, you might only have to do a quick refactoring of Wire.functionName() to TinyWireM.functionName(). Everything else is related to the QMC5883 chipset and using the QMC5883 output so if you get the I2C communication down, everything should will stay the same.