Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- #include <nRF24L01.h>
- #include <RF24.h>
- RF24 radio(53, 48); // CE, CSN
- const byte numSlaves = 3;
- const byte address[numSlaves][6] = {
- {"00001"},
- {"00010"},
- {"00100"}
- };
- String recv_buff[4];
- void setup() {
- Serial.begin(9600);
- radio.begin();
- radio.setPALevel(RF24_PA_MIN);
- radio.startListening();
- }
- void loop() {
- for (byte n = 0; n < numSlaves; n++){
- radio.openReadingPipe(0, address[n]);
- if (radio.available()) {
- const char text[32] = "";
- radio.read(&text, sizeof(text));
- String recv_tot = recv_buff[0] + recv_buff[1] + recv_buff[2];
- Serial.println(recv_tot);
- delay(2000);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement