Hi,My name is Efi and i would like to help me with something.
There are three arduinos on a model each of them has a temperature sensor DS18B20 Dallas and an antenna wireless communication nRF24L01.There is also an independent device consist of an arduino and a nRF24L01 antenna.Device act as receiver.Arduino and antenna play the role of transmitter.The code is
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Wire.h>
int temp1;
int WindSpeed;
int temp2;
int temp3;
RF24 radio(7, 8);
const uint64_t pipes[3] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL};
void setup()
{
//while (!Serial);
Serial.begin(9600);
radio.begin();
radio.setRetries(15, 15);
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(0, pipes[1]);
radio.openReadingPipe(1, pipes[2]);
radio.openReadingPipe(2, pipes[3]);
radio.startListening();
}
void loop()
{
if (radio.available())
{
radio.read(&temp1, sizeof(temp1));
Serial.println("Temp1:");
Serial.println(temp1);
delay(50);
radio.read(&WindSpeed, sizeof(WindSpeed));
Serial.println(" WindSpeed Bf : ");
Serial.println(WindSpeed);
delay(50);
radio.read(&temp2, sizeof(temp2));
Serial.println("temp2:");
Serial.println(temp2);
delay(50);
radio.read(&temp3, sizeof(temp3));
Serial.println("temp3:");
Serial.println(temp3);
delay(50);
}
else
{
Serial.println("No radio Data avaliable");
}
delay(3000);
}
The problemis that code sends some prices but the correspondence isn't right in Analog Read.How can i watch each pipe with the antenna of corresponding arduino in order to have the right results and each arduino send to receiver through its own antenna,the price of sensor?
Thanks all for your time!