I’m trying to add RF24 to my ESPNow base station.
Not a lot of sites have convincing wiring and short code for ESP.
There are two errors connected to ‘pipe’.
{
"resource": "/c:/Users/joema/Documents/PlatformIO/Projects/RF_ESP32_R32/src/main.cpp",
"owner": "cpp",
"severity": 8,
"message": "'const uint64_t pipe' redeclared as different kind of symbol",
"startLineNumber": 8,
"startColumn": 16,
"endLineNumber": 8,
"endColumn": 16
}
This is the code:
#include <Arduino.h>
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
char msg[6];
RF24 radio(12, 14, 26, 25, 27);
const uint64_t pipe = 0xE8E8F0F0E1LL;
void setup(void)
{
Serial.begin(115200);
radio.begin();
radio.setChannel(2);
radio.setPayloadSize(7);
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(1, pipe);
radio.startListening();
}
void loop(void)
{
if (radio.available())
{
radio.read(msg, 6);
Serial.println(msg);
delay(10);
}
else
{
//Serial.println("No radio available");
}
}
There are two redefinition complaints about a library file. I won’t worry about them if ‘pipe’ doesn’t work.