I have been trying to sent a hi message from my arduino uno to my raspberry pi4 .NO matter what i do there will be some kind of error i will face each time , i tried different coding approaches .In some code the hi message will be sent but it wont be received by the raspberry pi. Please provide the resources or then code .
#include <SPI.h>
//#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{
Serial.begin(9600);
radio.begin();
if(!radio.begin()){
Serial.println("hardware error");
}
radio.setRetries(15, 15);
radio.setChannel(10);
radio.openWritingPipe(rxAddr);
radio.stopListening();
}
void loop()
{
const char text[] = "Hello World";
bool x =radio.write(&text, sizeof(text));
if(x){
Serial.println("yes");
}
else{
Serial.println("no");
}
delay(1000);
Serial.println("Sent."); // TO check whether the data is sent.
}
this is my transmitter code and the output it is showing is hardware problem