I'm trying to combine the NRF24L01 with a 64x32 RGBmatrix, using the and ESP32 and P3RGB64x32MatrixPanel.h and Adafruit_GFX.h besides mandatory libraries for the NRF24L01.
The purpose is to send a message (the typeDef Struct I made) and print it on the RGB matrix
Regardless of the NRF24L01 the RGB display works like a charm, but I cannot get the NRF24L01 to work with the display
If I do not initialize the RGBmatrix the receiver code works like a charm, no problem.
And when the code runs, the radio.printDetails(); works as well, but something goes wrong with the radio.available, and I'm going crazy over it:
I've tried for a week now, and nothing in the order of initialization or re calling spi.begin works.
Is this an SPI issue or what?
I'm hoping for enlightenment.
Best Regards
//A lost Vulture in the Woods
The Code:
include
include
include
include // Core graphics library
include
// Radio pins
define CE_PIN 27
define CSN_PIN 26
define CLK_SPI 14 // 18
define MISO 12 // 19
define MOSI 13 //23
define SS 15 // HSPI 15 // Yes same pin as CSN, but it doesn't seem to matter.
// Matrix initialization
matrix.begin();
matrix.setTextSize(1); // size 1 == 8 pixels high
matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves
Hi.
I'm trying to combine the NRF24L01 with a 64x32 RGBmatrix, using the and ESP32 and P3RGB64x32MatrixPanel.h and Adafruit_GFX.h besides mandatory libraries for the NRF24L01.
The purpose is to send a message (the typeDef Struct I made) and print it on the RGB matrix
Regardless of the NRF24L01 the RGB display works like a charm, but I cannot get the NRF24L01 to work with the display
If I do not initialize the RGBmatrix the receiver code works like a charm, no problem.
And when the code runs, the radio.printDetails(); works as well, but something goes wrong with the radio.available, and I'm going crazy over it:
I've tried for a week now, and nothing in the order of initialization or re calling spi.begin works.
Is this an SPI issue or what?
I'm hoping for enlightenment.
Best Regards
//A lost Vulture in the Woods
The Code:
include
include
include
include // Core graphics library
include
// Radio pins
define CE_PIN 27
define CSN_PIN 26
define CLK_SPI 14 // 18
define MISO 12 // 19
define MOSI 13 //23
define SS 15 // HSPI 15 // Yes same pin as CSN, but it doesn't seem to matter.
//Matrix pins
define R1 23
define G1 22
define BL1 1
define R2 3
define G2 21
define BL2 19
define pin_A 18
define pin_B 5
define pin_C 17
define pin_D 16
define CLK_RGB 25
define LAT_RGB 32
define OE_RGB 33
bool doOnceRadio = true; bool rpdPrint; RF24 radio(CE_PIN,CSN_PIN);
unsigned long timeDifference;
const uint64_t pipe1 = 0xE8E8EEF0A1LL;; const uint64_t pipe2 = 0xA2LL;
const uint64_t pipe3 = 0xA3LL; const uint64_t pipe4 = 0xA4LL; const uint64_t pipe5 = 0xA5LL; const uint64_t pipe6 = 0xA6LL;
typedef struct { char filterChar[1]; bool testBitLED; bool startBit; bool reset1; uint8_t setDiscipline; unsigned long setDuration; unsigned long masterMillis; bool returnResult; uint16_t result; bool switchChannel; bool reset2; } TXstruct;
TXstruct message;
// Matrix pin constructor //P3RGB64x32MatrixPanel matrix; // default constructor P3RGB64x32MatrixPanel matrix(R1,G1,BL1,R2,G2,BL2,CLK_RGB,LAT_RGB,OE_RGB,pin_A,pin_B,pin_C,pin_D);
void setup() {
// Matrix initialization matrix.begin(); matrix.setTextSize(1); // size 1 == 8 pixels high matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves
matrix.setTextColor(matrix.color555(1,15,31)); matrix.setCursor(11, 2); matrix.println("Display"); matrix.setTextColor(matrix.color555(31,15,1)); matrix.setCursor(20, 12); matrix.println("Test"); matrix.setTextColor(matrix.color555(31,1,1)); matrix.setCursor(20, 22); matrix.println("Radio");
radio.begin(); radio.openReadingPipe(1,pipe1); // (1, const uint8_t *address) Pipe number (usually 1), pipe address (which is usually 5 bytes in an array structure). radio.setPALevel(RF24_PA_MIN); // RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH and RF24_PA_MAX radio.setDataRate(RF24_2MBPS); // 500kBPS 1MBPS 2MBPS radio.enableAckPayload(); radio.setRetries(15,15); radio.setChannel(108); // 0-124
radio.startListening(); }
void loop() {
if(doOnceRadio){ radio.printDetails(); doOnceRadio = false; }
if (radio.available()) {
timeDifference = message.masterMillis-millis();
delay(1000); } // End of if (radio.available()) } // end of void loop()
Relevant_libraries.zip