This code compiles ok.
I will first show what I can pull from the remote using the receiving sketch that came with the RCSwitch library
Decimal: 5592323 (24Bit) Binary: 010101010101010100000011 Tri-State: FFFFFFFF0001 PulseLength: 490 microseconds Protocol: 1
Raw data: 15224,460,1504,1456,536,444,1520,1452,532,440,1524,1452,524,460,1516,1444,548,440,1524,1436,540,448,1512,24,3780,88,240,64,144,200,152,56,128,284,508,236,16,48,16,248,3208,52,176,16,376,68,128,76,332,
That's what happens when I press the first button on my RF Remote.
Below is the code that compiles but does not do anything.
/*
Simple example for receiving
http://code.google.com/p/rc-switch/
*/
#include <RCSwitch.h>
int currentState = 0;
int RELAYSWITCH = 5; //Pin # that my relay's trigger/switching
//terminal is connected to
RCSwitch mySwitch;
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
pinMode(RELAYSWITCH, OUTPUT); //setting relay switch pin as output
}
void loop() {
if (mySwitch.available()) {
int value = mySwitch.getReceivedValue();
if (value == 5592323) {
if(currentState == HIGH)
currentState = LOW;
else
currentState = HIGH;
//what do you mean use currentState somehow? It isn't
//changing to show that it's a command or anything?
}
mySwitch.resetAvailable(); //What does this do???
}
}