Here is the pin map for the RedBoard Artemis:
https://github.com/sparkfun/Arduino_Apo ... pp#L25-L60
The line defining the "A4" pin is number 48 - it tells you that pin "A4" can also be called "20" and that those pins are handled by the Apollo3 pad #16.
This is confirmed by the following two lines:
https://github.com/sparkfun/Arduino_Apo ... nt.cpp#L72
https://github.com/sparkfun/Arduino_Apo ... iant.h#L68
So when you use "A4" in functions like "digitalWrite" it equates to the number 20. The number 20 is the index into the pin map array, and at that index the pad # listed is 16. So then internally operations are applied to pad # 16 of the Artemis module.
Here's the pin map entry for pin 5:
https://github.com/sparkfun/Arduino_Apo ... nt.cpp#L33
One of my qualms with the RBA is that certain pins do not have a pin number listed in silkscreen. It makes it hard to use them for functions other than what is listed (such as I2C or SPI).
There's no better way to solve that than be either referencing the datasheet or this portion of the variant.h file:
https://github.com/sparkfun/Arduino_Apo ... .h#L91-L98
On most boards you should begin using Wire and SPI before moving on to Wire
N and SPI
N. These peripherals are also mapped so that they will appear on the "expected" marked pins (unless no pins are marked for SDA/SCL or MISO/MOSI/SCLK, cause then there is no expectation and they are just on the pins they are on)
Let's go over how that works:
We define a value for "AP3_Wire_IOM" with this line:
https://github.com/sparkfun/Arduino_Apo ... iant.h#L41
In this case the value is 4
In the Wire library for Apollo3 that #define constant is used to create the standard "Wire" object that everyone knows and loves, and underneath it uses IO Main (IOM) #4.
https://github.com/sparkfun/Arduino_Apo ... #L363-L369
By checking the datasheet we see that IOM4 SCL is on Apollo3 pad 39 and IOM4 SDA is on Apollo3 pad 40.
https://cdn.sparkfun.com/assets/learn_t ... v0_9_1.pdf
By returning to the pinmap we can see that those pad #s correspond to pins 14 and 15, which are also labeled SDA4 and SCL4.
https://github.com/sparkfun/Arduino_Apo ... pp#L42-L43
Pins 14 and 15 are located on the board in the same place as the Arduino Uno I2C pins for shield compatibility, but unlike the Uno they are not connected to A4 and A5. They are their own independent pins (possible because Apollo3 has far more pads available than the 328p)
So - SCL and SDA on the RBA correspond with "Wire" in software and "IOM4" within the Apollo3. The internal details are unimportant and abstracted away for most users.
In the case of the SPI pins (MOSI, MISO, SCLK) they are accessed with the "SPI" object in software but they use "IOM0" behind the scenes.
I'm unsure how I can better help you. The unambiguous mappings are all available here:
https://github.com/sparkfun/Arduino_Apo ... f/variants
On top of that the RedBoard Artemis almost 100% pin-compatible with the Arduino Uno - sketches written for one should work on the other without modification. (performance concerns aside)
We had hoped that would be intuitive enough. Is there a way we can make it easier? I'd be happy to consider some changes. Thanks!