OK, I found some diagram on the web about the Aux pins:
Step 3 - Connecting and Calibrating Radio Control
and some code from ChatGPT:
=========================================
Certainly, you can repurpose the AUX 1, 2, 3, and 4 pins on the APM 2.8 board as digital pins for various projects. Here’s an example project idea that uses these pins as digital inputs to control LEDs:
Project: LED Control with APM 2.8 AUX Pins
In this project, you’ll use the AUX 1, 2, 3, and 4 pins on the APM 2.8 board as digital inputs to control individual LEDs. Each AUX pin will be connected to a push button switch, and when the button is pressed, it will turn on or off the corresponding LED.
Components Needed:
APM 2.8 board
Breadboard
LEDs (4)
220-470 ohm resistors (4)
Push button switches (4)
Jumper wires
Instructions:
Connect LEDs and Resistors:
Connect each LED's anode (longer lead) to a digital pin (AUX 1 to AUX 4) on the APM 2.8 board through a resistor (220-470 ohms). Connect the cathode (shorter lead) of each LED to the ground (GND) pin on the APM 2.8 board.
Connect Push Button Switches:
Connect each push button switch between the corresponding AUX pin and the ground (GND) pin on the APM 2.8 board.
Connect a pull-up resistor (10k ohms) between each AUX pin and the supply voltage (VCC) pin (typically 5V) on the APM 2.8 board.
Upload Arduino Sketch:
Use the Arduino IDE to write and upload a sketch that reads the status of each push button switch and controls the corresponding LED based on the button's state (pressed or released).
Here’s a simplified example code snippet to get you started:
arduino
#define AUX_PIN_1 54
#define AUX_PIN_2 55
#define AUX_PIN_3 56
#define AUX_PIN_4 57
void setup() {
pinMode(AUX_PIN_1, INPUT_PULLUP);
pinMode(AUX_PIN_2, INPUT_PULLUP);
pinMode(AUX_PIN_3, INPUT_PULLUP);
pinMode(AUX_PIN_4, INPUT_PULLUP);
pinMode(LED_BUILTIN, OUTPUT); // Use built-in LED as a status indicator
}
void loop() {
if (digitalRead(AUX_PIN_1) == LOW) {
digitalWrite(LED_BUILTIN, HIGH); // Turn on built-in LED
} else {
digitalWrite(LED_BUILTIN, LOW); // Turn off built-in LED
}
// Repeat the above logic for AUX_PIN_2, AUX_PIN_3, and AUX_PIN_4
}
Remember that this is a basic example to demonstrate using the AUX pins as digital inputs. You can expand upon this idea by adding more functionality, such as using the AUX pins to trigger different actions or controlling more complex devices.
Before implementing the project, make sure to review the APM 2.8 documentation and pinout diagrams to ensure you’re using the correct pins and connections for your specific board.
=========================================
I think I can do some experiment from here.