It's me, I'm back again. I heard you sigh ![]()
I believe I am almost complete in my task, however and I've spent a while looking over the code and can't work out the following.
// sensible name for when the button is pressed
// use when using a pullup resistor; change LOW to HIGH when using a pulldown resistor
#define ISPRESSED LOW
// number of preser channels
#define NUMPRESETS 6
// maximum number of 'digits' in preset
#define MAXDIGITS 3
#include <IRremote.h>
#include <IRremoteInt.h>
// switch pin
const int switchPin = 2;
// Create IR Send Object
IRsend irsend;
// selected preset
uint16_t selectedPreset;
// array with IR codes to be sent
// below contains 2 entries for presets; others default to all zeroes
// if a single digit (e.g. 1 instead of 001) is needed, populate the last one of the 3 and set the others t 0x0000
// this assumes that there is no code that uses 0x0000; you can change it to any unused code
uint16_t presets[NUMPRESETS][MAXDIGITS] =
{
{C05C06, C05C00, C05C01}, // preset 1; 601
{C05C06, C05C01, C05C04}, // preset 2; 614
{C05C06, C05C01, C05C05}, // preset 3; 615
{C05C06, C05C01, C05C07}, // preset 4; 617
{C05C06, C05C02, C05C00}, // preset 5; 620
{C05C06, C05C02, C05C03}, // preset 6; 623
}
 void setup()
 {
  // serial for debugging purposes
  Serial.begin(57600);
  // Set Switch pin as Input
  pinMode(switchPin, INPUT_PULLUP);
 }
 void loop()
 {
  // variable to remember the last button state; initialised to NOT ISPRESSED
  static int lastButtonState = !ISPRESSED;
  // read the pin
  int buttonState = digitalRead(switchPin);
  // if the button changed from RELEASED to PRESSED or the other way around
  if (buttonState != lastButtonState)
  {
   // remember the change
   lastButtonState = buttonState;
   if (buttonState == ISPRESSED)
   {
    // increment the preset
    selectedPreset++;
    // if we've reached the end of the presets, reset counter
    if (selectedPreset == NUMPRESETS)
    {
     selectedPreset = 0;
    }
    // send the IR code(s)
    sendIRCommand();
   }
  }
  // simple debounce delay
  delay(50);
 }
 /*
  send IR code to receiver
 */
 void sendIRCommand()
 {
  Serial.print("Sending preset ");
  Serial.println(selectedPreset + 1);
  for (int cnt = 0; cnt < MAXDIGITS; cnt++)
  {
   if (presets[selectedPreset][cnt] != 0x0000)
   {
    // display the information
    Serial.print(presets[selectedPreset][cnt], HEX);
    Serial.print(" ");
    // send the ir code to the TV (based on the code from your opening post)
    irsend.sendRC6(presets[selectedPreset][cnt], 24); // TV code
    delay(500);
   }
  }
  Serial.println();
 }
The problem I have is that now I've changed the IR codes to the captured IR codes from the remote, that the codes in lines 26 -31 come up with the following error "C05C06 was not declared in this scope" obviously this applies to all of the codes in this section. I can't work out why. Any suggestions or help would be most welcomed.[/code]