full code
changed somethings around, thanks for the help btw.
#include <Servo.h>
#include <Streaming.h>
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
const uint64_t LA = 0xF0F0F0F0A2LL;
RF24 radio(9, 10);
const int pinCE = 9;
const int pinCSN = 10;
byte val[3];
Servo LsMot;
void setup()
{
LsMot.attach(4);
Serial.begin(115200);
radio.begin();
radio.setAutoAck(false);
radio.setDataRate(RF24_2MBPS);
radio.startListening();
const uint64_t Readingpipe = LA;
}
void loop()
{
if
(radio.available())
{
radio.read(val, sizeof(val));
LsMot.write(val[0]);
//Serial.print("val[3] received: ");
//Serial.println(val[3]);
Serial << "value received: " << val[0] <<endl;// im looking for now just for the first gyro value to control the first servo
//val[0] = map(gz, -17000, 17000, 0, 180);//servo 1
}
}
/
this is masters sending imu gyro values
void loop()
{
for
(int i = 0; i < 6; i++) // initialization, loop continuation condition and incremental condition
{
mpu.getMotion3(&gx, &gy, &gz);
val[0] = map(gz, -17000, 17000, 0, 180);//servo 1
val[1] = map(gy, -17000, 17000, 0, 180);//servo 2
val[2] = map(gx, -17000, 17000, 0, 180);//servo 3
}
radio.write(&val[3], sizeof(val));
}
/