Guest User

Transmitter

a guest
Nov 28th, 2020
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SPI.h>
  2. #include <nRF24L01.h>
  3. #include <RF24.h>
  4.  
  5. RF24 radio(A0,A1);
  6.  
  7. const byte address[6] = "00001";
  8.  
  9. void setup() {
  10.   radio.begin();
  11.   radio.openWritingPipe(address);
  12.   radio.setPALevel(RF24_PA_MAX);
  13.   radio.setDataRate(RF24_250KBPS);
  14.   radio.stopListening();
  15. }
  16.  
  17. void loop() {
  18.   const byte mynum = 1;
  19.   radio.write(&mynum, sizeof(mynum));
  20.   delay(2000);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment