Skip to content

Instantly share code, notes, and snippets.

@marcokeur
Last active December 16, 2015 17:09
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 marcokeur/5468344 to your computer and use it in GitHub Desktop.
Save marcokeur/5468344 to your computer and use it in GitHub Desktop.
RF Lighthouse sourcecode
#include <JeeLib.h>
MilliTimer sendTimer;
char payload[] = "PONG";
byte needToSend;
void setup () {
Serial.begin(57600);
Serial.print("RF Lighthouse -");
rf12_config();
}
void loop () {
if (rf12_recvDone() && rf12_crc == 0) {
//done something with received shizzle
}
if (sendTimer.poll(3000))
needToSend = 1;
if (needToSend && rf12_canSend()) {
needToSend = 0;
rf12_sendStart(0, payload, sizeof payload);
Serial.println("PONG");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment