I'm a 4th grade student at the university. I can't solve the code part of my graduation project. I have 4 sensors. I get analog data from them. For example: 1.sensor:1023 2.sensor:1024 3.sensor:1023 4. sensor:1021 . I need to transfer this analog data from nrf24l01 to other nrf24l01. But I can only transfer 1 data. I want to transfer 4 of them at the same time. I've connected a capacitor to both the receiver and the transmitter.
Please help me in the code part ?
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
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
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
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
Thank you so much for guide. I used a 10pf capacitor by mistake. I will replace the capacitor..I write here if there is a problem again. Thanks again Robin2
void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, rxAddr);
radio.startListening();
}
void loop()
{
if (radio.available())
{
static int text = sensor1;
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
Using this code, I need to read and print values from A1, A2 and A3 analog pins, how can I write a code?
(Note:I took care of wireless problems in nrf24l01. Running smoothly.
Yes, I tried.I can read one sensor data. But I don't know what code to put the data on the 4 sensors. I'm just writing the part.My code for 1 sensor is:
Tx Code:
int sensor1;
sensor1= analogRead(A0);
static int text = sensor1;
radio.write(&text, sizeof(text));
delay(1000);
RX Code:
int sensor1;
if (radio.available())
{
static int text = sensor1;
radio.read(&text, sizeof(text));
Serial.println(text);
A1-A2-A3-A4 pin .I'm getting data from these pins. I want to see 4 data on a serial monitor at the receiving Arduino. Please help me coding.