I tried about a dozen different code snippets and chatgpt scripts but none worked. Turns out its simply because I didn't use a common ground. So now I have on Channel 4 just the Signal pin on a jumper from the RX to Pin 8, and then I have a Signal and Ground on Channel 5 connected to Pin 9 and GND respectively. Its currently still being powered by the USB although I will eventually take a feed off the BEC and step down the 6v to 5v so I can cleanly power the Arduino too.
The Traxxas TQi 6530 Transmitter (far right in image) has two additional switches compared to the regular TQi (left) although the top toggle actually shares Channel 4 and 5.

The red thumb toggle is Channel 3 and is now connected to a simple relay to turn my flashlights on/off. I could also connect this to the Arduino if I wanted but it seems to run fine this way and means less code writing.
The top toggle when its in Position 1 is means Channels 4 & 5 are both off. When in Position 1 it means Channel 4 is on, 5 is off. When in Position 3 it means Channels 4 and 5 are both on. It is not possible to activate Channel 5 without also turning on Channel 4.

The code is as follows (very basic at the moment)
Code: Select all#define Channel4Pin 8 // Pin for channel 4
#define Channel5Pin 9 // Pin for channel 5
void setup() {
Serial.begin(9600);
pinMode(Channel4Pin, INPUT);
pinMode(Channel5Pin, INPUT);
}
void loop() {
int channel4Value = pulseIn(Channel4Pin, HIGH); // Read pulse width of channel 4
int channel5Value = pulseIn(Channel5Pin, HIGH); // Read pulse width of channel 5
// Determine if pulse width of each channel is over 1500 microseconds
int channel4Output = (channel4Value > 1500) ? 1 : 0;
int channel5Output = (channel5Value > 1500) ? 1 : 0;
// Print the results
Serial.print("Channel 4: ");
Serial.print(channel4Output);
Serial.print(" | Channel 5: ");.
Serial.println(channel5Output);
delay(500);
}
Now when I use the top toggle switch it will output the following:
- Position 1 (all off) output... Channel 4: 0 | Channel 5: 0.
- Position 2 outputs... Channel 4: 1 | Channel 5: 0.
- Position 3 outputs... Channel 4: 1 | Channel 5: 1.
The next step is working out turning some servos on demand but I haven't fully thought out how I want this to work. I'm thinking Position 1, nothing... no lights, doors shut. Position 2 bar graph and red light illuminated, doors closed. Position 3 doors open, lights on.