Последние два дня я потратил на поиск способа установить базовую связь между nodemcu amica и arduino nano с помощью модуля nrf24l01;все это безуспешно ..
Вот код, загруженный на мой nodemcu:
//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//create an RF24 object
RF24 radio(D4, D8); // CE, CSN
//address through which two modules communicate.
const byte address[6] = "00001";
void setup()
{
Serial.begin(115200);
delay(2000);
radio.begin();
//set the address
radio.openWritingPipe(address);
//Set module as transmitter
radio.stopListening();
Serial.println("inizio ad trasmettere");
Serial.println(radio.isChipConnected());
}
void loop()
{
Serial.println("qui");
const char text[] = "Hello World";
bool ret = radio.write(&text, sizeof(text));
Serial.print("Write ret: ");
Serial.println(ret);
delay(1000);
}
, а вот код на стороне arduino
//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//create an RF24 object
RF24 radio(5, 6); // CE, CSN
//address through which two modules communicate.
const byte address[6] = "00001";
void setup()
{
Serial.begin(115200);
delay(2000);
radio.begin();
//set the address
radio.openReadingPipe(0, address);
//Set module as receiver
radio.startListening();
Serial.println("inizio ad ascoltare");
Serial.println(radio.isChipConnected());
}
void loop()
{
//Read the data if available in buffer
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
После моей проводкиконфиг nodemcu и arduino nano
Может кто-нибудь увидеть то, чего я не вижу?Я очень расстроен
Мой модуль nrf24l01 - это https://www.amazon.it/gp/product/B06WD17WLS,, а не модуль в схеме фризирования.