Hi,
I want to use ports 7 and 8 for digital input. Specially, I want to connect an RJ25 adapter to ports 7 and 8 and use both slot 1 and 2 for each
According to the Orion pinout image below…
-
Port 7 = A1, A6
-
Port 8 = A0, A7
The Orion is based on the Arduino Uno, which has analog pins A0-5, which are mapped as pins 14-19 for digital purposes.
When I run the following via the Arduino IDE Serial monitor…
int irfront_pin = mePort[7].s1;
int irrear_pin = mePort[7].s2;
int irleft_pin = mePort[8].s1;
int irright_pin = mePort[8].s2;
Serial.print("irfront_pin: "),Serial.println(irfront_pin);
Serial.print("irrear_pin: "),Serial.println(irrear_pin);
Serial.print("irleft_pin: "),Serial.println(irleft_pin);
Serial.print("irright_pin: "),Serial.println(irright_pin);
The serial monitor displays
irfront_pin: 20
irrear_pin: 15
irleft_pin: 21
irright_pin: 14
What is going on here?
Q1 - How does A6 exist on Port 6? if the Uno only goes up to A5?
Q2 - How does A7 exist on Port 7? if the Uno only goes up to A5?
Q3 - How does pin map 20 and 21 exist if A0-5 maps to 14-19?
regards
Michael