Sending to INPUTS across NRF24L01

Hey guys. I am coding arduino minis. They are communicating of nrf24l01 modules. On the transmitter side, I have a thumb joystick controlling the Y axis of a servo. This part works great. Im trying to add a button on the transmitter side to control a 5v output on receiver side. When i added code for the button it now does not let me control my servo and the 5v output is constant. I need the output to be 0V until i push button and i need the servo to work also.
THANKS for any help.

TRANSMITTER

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"  
#define CE_PIN   9
#define CSN_PIN 10 /* CE= pin 9  and CSN = pin 10 */
const byte pipe[6] = "00001";

RF24 radio(CE_PIN, CSN_PIN);

void setup(void)
{
  pinMode(A2, INPUT); 
  radio.begin();
  radio.setChannel(115);
  radio.openWritingPipe(pipe); 
  radio.setPALevel(RF24_PA_MAX); 
  radio.stopListening ();
}

void loop() 
{
  boolean buttonState = 0;
  int potValue1 = analogRead(A1); /* THUMB x */ 
  int angleV1 = map(potValue1,0,1023,0,180);
  radio.write(&angleV1,sizeof(angleV1));
  delay(5);
  buttonState = analogRead(A2);
  radio.write(&buttonState,sizeof(buttonState)); 
                 
}

RECIEVER

#include <Servo.h>
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#define CE_PIN   9
#define CSN_PIN 10 /* CE= pin 9  and CSN = pin 10 */
#define shooter 2
RF24 radio(CE_PIN, CSN_PIN);
Servo servo1;
const byte pipe[6] = "00001";
 

void setup()
{
  pinMode(shooter,OUTPUT);  
  servo1.attach(7); 
  radio.begin();
  radio.setChannel(115);
  radio.openReadingPipe(1,pipe);
  radio.setPALevel(RF24_PA_MAX);  
  radio.startListening();
}
void loop()
{
  if (radio.available())
  {
    while (radio.available()) 
    {
      boolean buttonState = 0;
      int angleV1 = 0;
      radio.read(&angleV1, sizeof(angleV1));
      servo1.write(angleV1);
      delay(5);
      radio.read(&buttonState, sizeof(buttonState));
      if (buttonState == HIGH)
      
        digitalWrite(shooter,HIGH);
      else 
       digitalWrite(shooter,LOW);
      
  }
}
}

Anyone know what might be happening?

You can easily just tell us how you have coded the commands to the receiver to tell it what to do. And have you use Serial.print() on the receiver end to see what it actually receives?

Paul

.

?

...R

Simple nRF24L01+ Tutorial