![]() There was always a problem of shields using SPI to work for both Uno and Mega boards without some kind of physical jumper or switch option to choose which board type it was to work with. So while the Uno and Mega does use different physical pin numbers for the SDA/SCL pins, this is not the results of the wire library or any other magic software trick. The SPI library (and wiring library) does not need to know the physical (or even the arduino abstraction pin name to operate) as the SPI is driven by internal hardware that are fixed to specific AVR pins, just like the hardware serial port for a Uno is only available on pins 0 and 1. When I saddle up the MEGA, change the IDE to recognize the chip, and import the Wire library, does the library recognize the changed pinout for the MEGA? My guess is yes, since the library description mentions the MEGA, but I'd like to be sure before I begin a rewire effort. Nowhere in my code did I need to identify the SDA/SCL pins: the Wire library apparently took care of that. In my project, I talk to two peripherals using SPI, and LCD display and a DS1307 clock. I started a project with an Arduino UNO R3, but the software grew too large, so I bought a MEGA 2560.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |