SHARE
TWEET

Untitled

a guest Oct 25th, 2016 146 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <nRF905.h>
  3. #include <SPI.h>
  4.  
  5. #define RXADDR {0xFE, 0x4C, 0xA6, 0xE5} // Address of this device (4 bytes)
  6. #define TXADDR {0x58, 0x6F, 0x2E, 0x10} // Address of device to send to (4 bytes)
  7.  
  8. #define ENQ {0x05}
  9. #define ACK {0x06}
  10. String reply;
  11. String replyH;
  12. String frame;
  13. String SOH = "0x01";
  14. String SA = "_EH1";
  15. String DA = "_EC1";
  16.  
  17. void setup() {
  18.   Serial.begin(9600);
  19.   nRF905_init();
  20.   byte addr[] = RXADDR;
  21.   nRF905_setRXAddress(addr);
  22.   byte addr1[] = TXADDR;
  23.   nRF905_setTXAddress(addr1);
  24.   nRF905_receive();
  25. }
  26.  
  27. void loop() {
  28. ml:
  29.   //SEND ENQ
  30.   byte replyH[NRF905_MAX_PAYLOAD] = ENQ;
  31.   //ENQ.getBytes(replyH, 32);
  32.   nRF905_setData(replyH, sizeof(replyH));
  33.   while (!nRF905_send());
  34.   nRF905_receive();
  35.   Serial.println("ENQ SENT");
  36.   Serial.println(replyH[0]);
  37.   Serial.write(replyH, sizeof(replyH));
  38.   Serial.println(" ");
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top