Advertisement
echentj

nRF24L

Nov 7th, 2012
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. radio.begin();
  2.  
  3. // optionally, increase the delay between retries & # of retries
  4. radio.setRetries(15,15);
  5.  
  6. // optionally, reduce the payload size. seems to
  7. // improve reliability
  8. //radio.setPayloadSize(8);
  9.  
  10. //
  11. // Open pipes to other nodes for communication
  12. //
  13.  
  14. // This simple sketch opens two pipes for these two nodes to communicate
  15. // back and forth.
  16. // Open 'our' pipe for writing
  17. // Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)
  18.  
  19. //if ( role == role_ping_out )
  20. {
  21. //radio.openWritingPipe(pipes[0]);
  22. radio.openReadingPipe(1,pipes[1]);
  23. }
  24. //else
  25. {
  26. //radio.openWritingPipe(pipes[1]);
  27. //radio.openReadingPipe(1,pipes[0]);
  28. }
  29.  
  30.  
  31.  
  32.  
  33. RF24/examples/GettingStarted/
  34. ROLE: Pong back
  35. *** PRESS 'T' to begin transmitting to the other node
  36. STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
  37. RX_ADDR_P0-1 = 0xe7e7e7e7e7 0xf0f0f0f0d2
  38. RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
  39. TX_ADDR = 0xe7e7e7e7e7
  40. RX_PW_P0-6 = 0x00 0x20 0x00 0x00 0x00 0x00
  41. EN_AA = 0x3f
  42. EN_RXADDR = 0x03
  43. RF_CH = 0x4c
  44. RF_SETUP = 0x07
  45. CONFIG = 0x0f
  46. DYNPD/FEATURE = 0x00 0x00
  47. Data Rate = 1MBPS
  48. Model = nRF24L01+
  49. CRC Length = 16 bits
  50. PA Power = PA_HIGH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement