LED Switch with RF RCSwitch

Good evening everyone,

Excuse me if my English is not perfect, I am French.

I’m stuck on a problem with the RF 433MHz.

Let me explain,

I send a value by a remote control, this value will turn on or off a lamp. Except that if you do a continuous press, the lamp will blink, logical.
I bought the adapter a code I had made for the use of a pushbutton that works perfectly but could not use it with wireless.
The code is that as long as I support, I do not move on as a result of the program.
I use the RC-Switch library which I find very convenient.
Just have a simple handling, but I’ve been going round in circles for a while.

Here is the code for the pusher:

const int LED = 8;
const int PUSH = 12;


int compteur = 0;

void setup(){
 
  pinMode(LED, OUTPUT);
  pinMode(PUSH, INPUT);
 
  digitalWrite(LED, LOW);
 
}

void loop(){
 

  if (digitalRead(PUSH) == HIGH)   //Si value = 3283
  {
    compteur = compteur + 1;
    while(digitalRead(PUSH) == HIGH);
    delay(50);
  }

  if(compteur == 0)
  {
    digitalWrite(LED, LOW);
  }
 
  if(compteur == 1)
  {
    digitalWrite(LED, HIGH);
  }
 
  if(compteur == 2)
  {
    compteur = 0;
  }
}

And the one for the RF (The serial link serves me to see what happens):

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

const int LED = 8;
int value = 0;


boolean compteur = 0;

void setup(){
  Serial.begin(9600);
  mySwitch.enableReceive(0);
 
  digitalWrite(LED, LOW);
  Serial.begin(9600);
}

void loop(){
 

  if (mySwitch.getReceivedValue() == 3283)   //Si value = 3283
  {
    compteur = compteur + 1;                //Compteur est incrémenté de +1
    mySwitch.resetAvailable();
    delay(50);
    while(mySwitch.getReceivedValue() == 3283);
    {
      mySwitch.resetAvailable();
    }
    delay(50);
  }
  mySwitch.resetAvailable();
 
  if(compteur == 0)
  {
    digitalWrite(LED, LOW);
    Serial.println("OFF");
  }
 
  if(compteur == 1)
  {
    digitalWrite(LED, HIGH);
    Serial.println("ON");
  }
 
  if(compteur == 2)
  {
    compteur = 0;
  }
}

For HF, I see hundreds of “on” and then after hundreds of “off” support, but the change is done all the time of the press, it is not blocked during the press.

I hope that I could explain myself as easily as possible and that you can help me.

I thank you in advance.

Good evening to you.
gg25