Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <nRF905.h>
- #include <SPI.h>
- #define RXADDR {0xFE, 0x4C, 0xA6, 0xE5} // Address of this device (4 bytes)
- #define TXADDR {0x58, 0x6F, 0x2E, 0x10} // Address of device to send to (4 bytes)
- #define ENQ {0x05}
- #define ACK {0x06}
- String reply;
- String replyH;
- String frame;
- String SOH = "0x01";
- String SA = "_EH1";
- String DA = "_EC1";
- void setup() {
- Serial.begin(9600);
- nRF905_init();
- byte addr[] = RXADDR;
- nRF905_setRXAddress(addr);
- byte addr1[] = TXADDR;
- nRF905_setTXAddress(addr1);
- nRF905_receive();
- }
- void loop() {
- ml:
- //SEND ENQ
- byte replyH[NRF905_MAX_PAYLOAD] = ENQ;
- //ENQ.getBytes(replyH, 32);
- nRF905_setData(replyH, sizeof(replyH));
- while (!nRF905_send());
- nRF905_receive();
- Serial.println("ENQ SENT");
- Serial.println(replyH[0]);
- Serial.write(replyH, sizeof(replyH));
- Serial.println(" ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement