I am writing some custom code for my APM2.5 and am having trouble mapping the I/O pins that are brought out on the enclosure against the Mega 2560 pin outs. I have the APM2.5 schematic and have the Mega 2560 mapping. Trying to get a Radio RX output signal (PWM) to Input 1 on the APM2.5 From the APM2.5 schematic, PWM Input 1 is "IN7". "IN7" goes to "(PCINT7/OCoA/OC1C)Pb7". The APM schematic says its pin 21 on the "ATMEGA32U2". How do I get from the "ATMEGA32U2" to the AT2560? When I load code isnt it going to the AT2560?
I also tried to use"A0" (pin 97) as my input on APM2.5 but still not seeing the value I expected on my serial monitor. Below is the code that I am using...
int SteeringInputPin = 97; // Steering Servo Channel Input Pin
int SteeringValue= 50; // Steering Servo Channel Input Value
// Setup Routine
pinMode(SteeringInputPin, INPUT); // declare the SteeringInputPin as an INPUT:
Serial.begin(9600); // initialize serial communication at 9600 bits per second:
SteeringValue = pulseIn(SteeringInputPin, HIGH); // Read the pulse width of Steering Command
Anyone have a reliable mapping of the APM2.5 pinouts to the underlying Mega 2560 board? Any help would be much appreciated.