Skip to content

Instantly share code, notes, and snippets.

@TURBULENTE
Created May 30, 2016 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TURBULENTE/9b819784b424d934e7342e4d1875e029 to your computer and use it in GitHub Desktop.
Save TURBULENTE/9b819784b424d934e7342e4d1875e029 to your computer and use it in GitHub Desktop.
Hola radiocomunicación! + nrf24L01+
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, rxAddr);
radio.startListening();
}
void loop()
{
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
byte poten;
void setup()
{
Serial.begin(9600);
radio.begin();
radio.setRetries(15, 15);
radio.openWritingPipe(rxAddr);
radio.stopListening();
}
void loop()
{
poten=analogRead(A0);
const char text[] = "Hola radiocomunicación!";
radio.write(text,sizeof(text));
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment