Guest User

Untitled

a guest
Apr 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //SEND - ATTINY85
  2.  
  3. #define CE_PIN 3
  4. #define CSN_PIN 4
  5.  
  6. #include "RF24.h"
  7.  
  8. RF24 radio(CE_PIN, CSN_PIN);
  9.  
  10. const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
  11. unsigned long Command = 1;
  12.  
  13. void setup()
  14. radio.begin();
  15. radio.setRetries(15,15);
  16. radio.openReadingPipe(1,pipes[1]);
  17. radio.startListening();
  18. radio.printDetails();
  19. radio.openWritingPipe(pipes[0]);
  20. radio.openReadingPipe(1,pipes[1]);
  21. radio.stopListening();
  22. }
  23.  
  24. void loop(void)
  25. {
  26. radio.stopListening();
  27. radio.write( &Command, sizeof(unsigned long) );
  28. radio.startListening();
  29. Command++;
  30. delay(1000);
  31. }
Add Comment
Please, Sign In to add comment