I am using tft_espi library and I am trying to use an SD card (external module) on the same bus(VSPI) and NRF24L01 on the other one(HSPI), but when i upload the sketch everything works fine exept the touchscreen and the RF24 initialization is failing, but somehow it sends the signal. Is it even possible to make all these components work together?
#include <TFT_eSPI.h>
#include <SD.h>
#include "WiFi.h"
#include "RF24.h"
#include <RF24Network.h>
//display pins in the userSetup.h
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15
#define TFT_DC 2
#define TFT_RST 4
#define TOUCH_CS 16
SPIClass* hspi = new SPIClass(HSPI);
TFT_eSPI tft = TFT_eSPI();
RF24 radio(27, 26); //CE CSN
RF24Network network(radio);
const uint16_t master_node = 00;
const uint16_t slave_node = 01;
void init_tft() {
tft.begin();
tft.setRotation(3);
tft.fillRect(0, 0, 320, 240, BLACK);
draw_navbar();
show_time_format(rtc.getHour(h12, AM_PM), rtc.getMinute(), rtc.getSecond(), 90, 10, 3, GRAY);
draw_buttons(pages[0].num_of_btns, pages[0].buttons);
digitalWrite(tft_backlight, HIGH);
}
void setup() {
Serial.begin(115200);
Wire.begin();
hspi->begin();
//pins mode
pinMode(tft_backlight, OUTPUT);
//tft
init_tft();
//card sd
if (SD.begin()) {
Serial.println("SD found");
} else {
Serial.println("SD NOT found");
}
//rf24
if (!radio.begin()) {
Serial.println("Radio hardware not responding!");
}
radio.setChannel(90);
network.begin(master_node);
//wifi
WiFi.mode(WIFI_STA);
}
This is how i send the signsl. For now nothing is receiving it
RF24NetworkHeader header(slave_node);
bool ok = network.write(header, ¤t_time_seconds, sizeof(current_time_seconds));
Serial.println(ok ? F("ok.") : F("failed."));
This is only a part of the code because it pretty long...


