Skip to content

Instantly share code, notes, and snippets.

@IOT-123
Last active April 18, 2018 05:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save IOT-123/2d0ea74bfdbc3521385a02dce8cf411e to your computer and use it in GitHub Desktop.
//SEND - ATTINY85
#define CE_PIN 3
#define CSN_PIN 4
#include "RF24.h"
RF24 radio(CE_PIN, CSN_PIN);
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
unsigned long Command = 1;
void setup()
radio.begin();
radio.setRetries(15,15);
radio.openReadingPipe(1,pipes[1]);
radio.startListening();
radio.printDetails();
radio.openWritingPipe(pipes[0]);
radio.openReadingPipe(1,pipes[1]);
radio.stopListening();
}
void loop(void)
{
radio.stopListening();
radio.write( &Command, sizeof(unsigned long) );
radio.startListening();
Command++;
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment