Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

NRF24l01 auto pairing device with HM10

I want to ask about NRF24l01, can it be connected directly using HM10 bluetooth? can you give a reference to the problem? I was tired of looking for it, because on average, for NRF auto pairing devices use Nordic, and what I want is not to use Nordic. thank you before.

this for code

[transmitter 1]

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define LED1 2

RF24 radio(7, 8);
const uint64_t pipes[3] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL };

void setup(void) {
Serial.begin(9600);
radio.begin();
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipes[1]);
radio.startListening();

pinMode(LED1, INPUT);
}

void loop(void)
{
const char text1[] = "Terima A";
digitalWrite(LED1, HIGH);
radio.write(&text1, sizeof(&text1));
delay(10);
}

[Transmitter 2]

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define LED2 3

RF24 radio(7, 8);
const uint64_t pipes[3] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL };

void setup(void) {
Serial.begin(9600);
radio.begin();
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipes[2]);
radio.startListening();

pinMode(LED2, INPUT);
}

void loop(void)
{
const char text2[] = "Terima B";
digitalWrite(LED2, HIGH);
radio.write(&text2, sizeof(&text2));
delay(10);
}

[Receiver]

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(9, 10);
const uint64_t pipes[3] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL };

void setup(void) {
Serial.begin(9600);
radio.begin();
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(1, pipes[1]);
radio.openReadingPipe(2, pipes[2]);
radio.startListening();
}

void loop(void)
{
if ( radio.available() )
{
const char text1[] = "Terima A";
const char text2[] = "Terima B";
delay(50);
radio.read(&text1, sizeof(&text1));
lcd.print("Led 1");
lcd.print(&text1);

delay(50);
radio.read(&text2, sizeof(&text2));
lcd.print("Led 2");
lcd.print(&text2);

}
else
{
Serial.println("No radio available");
}
delay(1000);
}

Comments