Hello , I am a beginner and I am trying to make a IR controlled car with an Arduino UNO, L293D motor driver, IR receiver, 2 geared BO motors (6V), old RC helicopter remote (which has 3 channels, 4-5 buttons, 2 joysticks), a few LEDs, etc. I am having a problem in obtaining the HEX codes for each direction (as there are so many combinations of different positions of the joysticks, each with a separate HEX code) as 1 joystick controls the speed of the vehicle and 1 controls the direction of motion. I want to know if there is an easier method to map out every hex code so that I can implement the codes in my program and see it working.
// Current code
#include <IRremote.h>
const int IR_PIN = 11; // IR receiver connected to pin 11
IRrecv irrecv(IR_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.print("Code: 0x");
Serial.println(results.value, HEX);
irrecv.resume(); // Wait for next signal
}
}
