HC-12 and Servo

Hello there,

I am currently trying to successfully write a script for two HC-12 Wireless Serial Port Communication Modules that will move a servo 90 degrees when a pushbutton is pressed. This requires the use of two arduino unos. The first arduino (the sender) is wired up to a button as well as an HC-12 module. The second arduino (the receiver) is hooked up to a servo (with an external 6v source) as well as another HC-12 module. When the button is pressed a wireless signal is sent from one arduino to the other. The problem that I am having is the servo will not stay in a position when I push the button. I want the servo to move to 90 degrees when the button is pressed once and stay in that position. Now when I press the button a second time I want the servo to move to 10 degress and stay in that position.

Could anyone help me out and show me what I am doing wrong?

Here is my code for the receiving arduino:

#include <SoftwareSerial.h>

#include <Servo.h>

SoftwareSerial mySerial(2, 3); // RX, TX

int servopin = 9;

Servo servo1;

void setup() {
  mySerial.begin(9600);
  pinMode(servopin, OUTPUT);
  servo1.attach(9);
}

void loop() {
   
  if(mySerial.available() > 1){    
    int input = mySerial.parseInt();//read serial input and convert to integer (-32,768 to 32,767)    
    if(input == 1111){//if on code is received
      servo1.write(90);
      delay(5);
    }
    if(input == 0000){//if off code is received
      servo1.write(10);
      delay(5);
    }
  }
  mySerial.flush();//clear the serial buffer for unwanted inputs     
  
  delay(20);//delay little for better serial communication
 
}

Thank you!

And the sender code looks like.... ? ? ?

Sorry, I meant to post it. Here is the sender code:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); //RX, TX

int buttonPin = 8;
boolean onOff = 0;
void setup() {
  pinMode(buttonPin, INPUT);
  mySerial.begin(9600);
}

void loop() {
 
  int buttonState = digitalRead(buttonPin);//read button state
  
  if(buttonState == 1){//if button is down
    mySerial.println(1111);//send unique code to the receiver to turn on. In this case 1111
    onOff = 1;//set boolean to 1
  }
  if(buttonState == 0 && onOff == 1){//Verifier to send off signal once
    mySerial.println(0000);//send unique code to the receiver to turn off. In this case 0000
  }
  delay(20);//delay little for better serial communication
}