Last active
April 18, 2018 05:29
Star
You must be signed in to star a gist
Code derived from https://www.theengineeringprojects.com/2015/07/interfacing-arduino-nrf24l01.html for testing on https://www.instructables.com/id/IOT123-5PIN-ATTINY85-NRF24L01-BRICK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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