I have an a arduino transmiter setup with the nFR24L01 transever. When I try to send data between a arduino mega and an arduino uno, the serial monitor shows garbage.
Here is my code:
Mega:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CNS, CE
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World, tw";
radio.write(&text, sizeof(text));
delay(500);
radio.write("what about this?",15);
delay(500);
}
Uno:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CNS, CE
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
delay(1000);
Serial.println("Hello to the world.");
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
//delay(1000);
if (radio.available()) {
char text[32] = "";
radio.read(&text, 15);
Serial.println(text);
}
}
My Scematic Thanks in advance!