Trying to turn servo wirelessly. Receiver cant interpret data being transmitted

Hey everyone, I'm at the final step of this part of a project. Im following the basic structure of this: https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/

My receiver can receive the data from button1, but when I open up the serial monitor I just get the empty squares as the data being received. ""

Basically when I switch from high and low on pin 6 on the transmitter, I just want the servo to turn from 180 to 0 degrees on the receiver.

Thank you for your time.

Here are my codes:

Transmitter

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};
boolean buttonState = 0;
int button1 = 6; //button pin, connect to ground to move servo

void setup() {
 
  pinMode(button1, INPUT);
  digitalWrite(6, HIGH);
  
  radio.begin();
  radio.openWritingPipe(addresses[1]); // 00001

  radio.setPALevel(RF24_PA_MIN);
}
void loop() {

  radio.write(&button1, sizeof(button1));
  
  
}

Receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Servo.h>
#define button 4
RF24 radio(7, 8); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};

Servo servo1;
int press1 = 0;

void setup() {
  pinMode(button, INPUT);
  Serial.begin(9600);
  
  servo1.attach(2);
  radio.begin();
  
  radio.openReadingPipe(1, addresses[1]); // 00001
  radio.setPALevel(RF24_PA_MIN);
}
void loop() {
  radio.startListening();
  
  if ( radio.available()) {
    while (radio.available()) {
      
     
      int button1; 
      pinMode(button1, INPUT);
            
      radio.read(&button1, sizeof(button1));
    
      
      press1 = digitalRead(button1);
      Serial.write(button1);
      
      if (press1 == LOW)
      {
      servo1.write(0);
      }
      else {
      servo1.write(180);
    }
  }}}

Hi,
This may help;

https://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-ExampleSketches

Tom... :slight_smile:

Have a look at this Simple nRF24L01+ Tutorial.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

...R