So I trying to control relay remotely (433mhz) with a button that when I pressed the button the relay open (send the code word) and when I stop the push of a button (send again codeword just once) then close relay.
Well, the program always sanding the code.
here is:
void loop()
{
buttonState = digitalRead(buttonPin);
// if the pushbutton is pressed.
digitalWrite(ledPin2, HIGH); // turn LED on:
Temporary[2] = 0x0C;// 0x0C is C button key
digitalWrite(ledPin, HIGH);//Turn on led
send_data();//send code word
Serial.println(".....trigger C channel relay remote ON");
}
else
{
digitalWrite(ledPin2, LOW);
Temporary[2] = 0x0C;// 0x0C is C button key
digitalWrite(ledPin, HIGH);//Turn on led
send_data();//send code word
Serial.println(".....trigger C channel relay remote OFF");
}
I know sending a data because this in a loop but I wnat to running just once