Browse Source

removed already in master integrated Code (radioControl)

master
Lukas Reichwein 5 years ago
parent
commit
d6be43f96e
  1. 27
      Arduino/receiver_code/receiver_code.ino
  2. 22
      Arduino/transmitter_code/transmitter_code.ino

27
Arduino/receiver_code/receiver_code.ino

@ -1,27 +0,0 @@
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(A0, 3); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MAX);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.print("received: ");
Serial.println(text);
}
}

22
Arduino/transmitter_code/transmitter_code.ino

@ -1,22 +0,0 @@
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(A2, A3); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MAX);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
}
Loading…
Cancel
Save