• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
komunikacja nrf 24l01
#4
Zobacz jeszcze to, działa  u mnie i komuś też to wrzuciełem na forum z potwierdzeniem, że działa.
Nadajnik
Kod:
/*
* Arduino Wireless Communication Tutorial
*     Example 1 - Transmitter Code
*               
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}
void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}


Odbiornik
Kod:
/*
* Arduino Wireless Communication Tutorial
*       Example 1 - Receiver Code
*               
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
  Serial.begin(115200);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN); //pomaga bez kondensatora
  radio.startListening();
}
void loop() {
  if (radio.available()) {
    char text[32] = {0};
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

Jak to nie zadziała to szukaj problemów w sprzęcie, zasilaniu i kabelkologii.
Miło być decenianym https://buycoffee.to/kaczakat
 
Odpowiedź
  


Wiadomości w tym wątku
komunikacja nrf 24l01 - przez kasilos - 30-07-2019, 12:26
RE: komunikacja nrf 24l01 - przez kaczakat - 30-07-2019, 15:33
RE: komunikacja nrf 24l01 - przez kasilos - 30-07-2019, 18:32
RE: komunikacja nrf 24l01 - przez kaczakat - 31-07-2019, 21:41
RE: komunikacja nrf 24l01 - przez kasilos - 01-08-2019, 18:32
RE: komunikacja nrf 24l01 - przez kaczakat - 02-08-2019, 10:20
RE: komunikacja nrf 24l01 - przez kasilos - 02-08-2019, 13:22

Skocz do:


Przeglądający: 1 gości