If you can find the corresponding definition in the header files, you can use this. As far as I know the ArduinoIDE also uses these to include the right header files for each target. ![]() If you want to create code, that is reusable both on Uno and ATTiny, than I would suggest to use a combination of #define and #ifdef, #ifndef and #endif directives, so that depending on a defined flag only the corresponding code is compiled. If you just want to pretent, that it would really be the Wire library, this might not be a good coding practice, since this somewhat hides the fact in your code, that you use not the Wire library, but a different library. I don't understand completely, why you want to rename the TinyWireM library to Wire. ![]() The TinyWireM library shows almost the same behavior as the Wire library on the Uno, but is not the same library ported to the ATTiny. ![]() The Wire Library doesn't work on the ATTiny, because it has only a USI (Universal Serial Interface), which is not the same hardware as in the Arduino Uno.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |