Last active
December 16, 2015 17:09
-
-
Save marcokeur/5468344 to your computer and use it in GitHub Desktop.
RF Lighthouse sourcecode
This file contains hidden or 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
#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