It works with entire I2C transmissions and messages, instead of individual bytes, addresses, and START/STOP/ACK/NACK conditions. And it works well across all the AVR and ARM devices that use the Arduino software format, both now and in the future. The commands for the Wire library for Arduino look different from all the other I2C libraries, but it works well. I've been reading and studying it for years and am just about at the point where I feel comfortable with it. Two-Wire interface is a complicated subject. That doesn't mean that this library is deficient or inflexible. Arduino was designed to be an easy-to-use standard for beginners and people who want to integrate a microcontroller in a semi-custom project without many hours of technical study and code re-writing. It works, it is documented, it is as straight-forward and easy-to-understand as I2C (Two Wire) is going to get, and everybody in ArduinoLand uses it. If you are using the Arduino, stick with the Wire library. I plan on digging into the Wire library to see why, but I was wondering if someone knows why these 2 libraries interpret the address differently.Īllow me to put my two cents worth in here. So using 0x40 with the Wire Library does not work but with the Peter Fleury library it does and visa versa. Using the Arduino library, I can scan with this sketch. Using the library I linked below, the address is correct and I can communicate on address 0x40 B0010 0000. I have configured the address (A0, A1 and A2) to 000 (e.g all tied to ground). I am testing with a MCP23017 i2c expanded. check if the device has acknowledged the READ / WRITE mode I added the following method to simply check if an address is valid on the bus. I've been working with a simple i2c library (Peter Fleury).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |