Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <RF24.h>
- #include <nRF24L01.h>
- #include <SPI.h>
- RF24 radio(8,7);
- byte radReadBuffer[16];
- void setup()
- {
- Serial.begin(57600);
- radio.begin();
- radio.disableCRC();
- radio.setAutoAck(false);
- radio.enableDynamicPayloads();
- // adres of reciever??
- const uint64_t rx_tx_addr = reinterpret_cast<const uint64_t>("\x6D\x6A\x73\x73\x73");
- radio.openReadingPipe(0, rx_tx_addr);
- //mjx bind channel
- radio.setChannel(8);
- radio.startListening();
- Serial.println("START");
- }
- void loop()
- {
- if(radio.available())
- {
- radio.read(radReadBuffer, 16);
- Serial.println("GOT PACKET");
- for(int i = 0; i < 16; i++)
- {
- Serial.print((int)radReadBuffer[i]);
- Serial.print(" ");
- }
- Serial.println("GOT PACKET END");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement