Advertisement
hwthinker

Nano nRF24L01 - Transmitter

May 17th, 2021 (edited)
947
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //transmitter
  2. #include <SPI.h>
  3. #include <nRF24L01.h>
  4. #include <RF24.h>
  5.  
  6. RF24 radio(7, 8); // CE, CSN
  7.  
  8. const byte address[6] = "00001";
  9.  
  10. void setup() {
  11.   radio.begin();
  12.   radio.openWritingPipe(address);
  13.   radio.setPALevel(RF24_PA_MIN);
  14.   radio.stopListening();
  15. }
  16.  
  17. void loop() {
  18.   const char text[] = "Halo Apakabar";
  19.   radio.write(&text, sizeof(text));
  20.   delay(1000);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement