Advertisement
Guest User

Untitled

a guest
Sep 26th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1.  
  2. #include <SPI.h>
  3. #include <nRF24L01.h>
  4. #include <RF24.h>
  5. RF24 radio(7, 8); // CE, CSN
  6. const byte repeater1 = "00001";
  7. const byte device = "00002";
  8. void setup() {
  9.  
  10. }
  11. void loop() {
  12.  
  13. If(gomb megnyom) {
  14. radio.begin();
  15. radio.openWritingPipe(address);
  16. radio.setPALevel(RF24_PA_MIN);
  17. radio.stopListening();
  18. const char text[] = "uzenet";
  19. radio.write(&text, sizeof(text));
  20. delay(1000);
  21.  
  22. radio.begin();
  23. radio.openWritingPipe(address2);
  24. radio.setPALevel(RF24_PA_MIN);
  25. radio.stopListening();
  26. const char text[] = "uzenet";
  27. radio.write(&text, sizeof(text));
  28. delay(1000);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement