/*
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???
}
}
So how do I put that into this code? Do I put the unsigned long value bit before setup??
Also, at the end of the sketch what does the last line do "myswitch.resetavailable" ?