I created a project using a breadboard and an arduino uno rev4 wifi. It is my first project so I started most functionality based on the examples, this includes for example connecting to wifi, doing http calls to a server...
Now I've created a soldered perfboard with an arduino nano iot on it. I had assumed the code would be portable but this does not seem to be the case.
Ideally I would like to create a common codebase that uses the same components so I can alternate between prototyping on the breadboard and the uno and creating a smaller version with the nano.
If that is not possible I would still like to retain a single codebase to share as much as possible and use different implementations where necessary depending on the target device. How would I go about including/excluding specific files based on the compilation target?
So far I have at least two parts of the application that do not appear to work on the nano:
wifi+http using WiFiS3 (as per the uno example). Is there a library that works on both?
eeprom: i use eeprom to store a persistant value (a generated identity)
I managed to get the project compiled for both devices.
The WifiNINA library compiles for the nano but not for the uno. It does appear that it has the exact same API as the WifiS3 though, so I am currently using this to switch implementations.
I had trouble tracking down the name ARDUINO_UNOWIFIR4 though, finally found it by grepping the arduino folder for some random strings. Is there a centralized list of these definitions?
Why not use a Nano IOT for the breadboard prototyping? With header pins installed (facing downward), the Nano IOT can be directly inserted into a breadboard.
I think that name comes from adding "ARDUINO_" to the text from the build.board line in the boards.txt file. This is a list from all the Arduino board packages I currently have on my computer: