![]() #define DATA_OUTPUT_X_LSB_REGISTER 0x04 //Read #define DATA_OUTPUT_X_MSB_REGISTER 0x03 //Read Here's my code, for application code in the Arduino IDE, and the code in the library. I think the initialize is working ok, but the read procedure may not as it should be. I'm not sure if this could cause some problems.īut, because I don't have a complete understanding of how twi works, I'm trying to understand things now as displaying the content that is going in the ISR. I'm using Serial.prints inside/outside the ISR to debug my coding. My test code is to initialize the HMC5883L, and read back those configuration setting from the first SFRs of the HMC5883L. I actually ran through different i2c libraries for avr and this code library is one of the best IMHO. What I did actually, is that I copied the header/source files from the Arduino path F:\Program Files\Arduino\hardware\arduino\avr\libraries\Wire\src\utility and put them in the Arduino custom libraries and changed the. I'm studying the Wire library code driver utility/twi.h to learn how twi buffering and ISR management work. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |