dthain / QMC5883L

Driver for QMC5883L chip found in many GY-271 boards.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ATTiny85 compile issue

gitandrewd opened this issue · comments

Hi,

Firstly,thanks for this library :) I wanted to use your library in a project but found it wouldnt compile for the ATtny85. Below is the error message. Is there anyway I can fix this?
Thanks for your time
Dave

Arduino: 1.8.5 (Mac OS X), Board: "ATtiny25/45/85, Disabled, CPU, ATtiny85, 8 MHz (internal), EEPROM retained, B.O.D. Disabled"
/Users/daveandrew/Documents/Arduino/libraries/QMC5883L-master/QMC5883L.cpp: In member function 'void QMC5883L::init()':
/Users/daveandrew/Documents/Arduino/libraries/QMC5883L-master/QMC5883L.cpp:149:6: error: 'TWCR' was not declared in this scope
if(TWCR==0) Wire.begin();
^
exit status 1
Error compiling for board ATtiny25/45/85.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Hi,
I basically struck out from the cpp file:

//Initialize Wire only if not already done.
// if(TWCR==0) Wire.begin();
// reset();

I include Wire.begin() in the setup and all seems to be fine.

Has what I done ok?

Thanks
Dave

Hello @gitandrewd - yes, that is the right solution, and it is incorporated into v1.0.8, which is just released. Thanks!

Thanks again!