CobraV2/receiver_module/receiver_module.ino
foglar 97d57b139b Added directories for saving logs
- slightly edited .ino files
- documentation added
- now it will save the logs in special directories on any os
2024-01-29 16:54:26 +01:00

23 lines
598 B
C++

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 8); // CE, CSN
const byte address[6] = "00001"; //address through which two modules communicate
void setup() {
while (!Serial)
;
Serial.begin(9600);
Serial.println("# Reciever Init");
radio.begin();
radio.openReadingPipe(0, address); //set the address
radio.startListening(); //Set module as receiver
}
void loop() {
//Read the data if available in buffer
if (radio.available()) {
char text[32] = { 0 };
radio.read(&text, sizeof(text));
Serial.println(text);
}
}