This is the transmitter code:
#include <SPI.h>
#include <printf.h>
#include <nRF24L01.h>
#include <RF24_config.h>
#include <RF24.h>
RF24 radio(9,10); // CE, CSN
const byte address[6] = "00001";
const int vibrationSensor = 8;
//boolean vibrationValue = "0";
int SensorData[0];
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(vibrationSensor, INPUT);
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
// put your main code here, to run repeatedly:
SensorData[0] = digitalRead(vibrationSensor);
Serial.println(SensorData[0]);
radio.write(&SensorData, sizeof(SensorData));
}