Skip to content

Instantly share code, notes, and snippets.

@kinasmith
Created May 10, 2017 18:54
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 kinasmith/79f62b9fc9d48f2e71a1409789a28510 to your computer and use it in GitHub Desktop.
Save kinasmith/79f62b9fc9d48f2e71a1409789a28510 to your computer and use it in GitHub Desktop.
sd and clock and radio working in LOOP
bool write_to_sd = false;
if (radio.receiveDone())
{
Serial.println(radio.SENDERID);
if (radio.SENDERID == 2) {
write_to_sd = true;
}
rtc.update();
printTime();
if (radio.ACKRequested()) {
}
}
if (write_to_sd) {
if (file.open("callback.txt", O_CREAT | O_WRITE)) {
file.println("time");
file.close();
Serial.println("sd card yes");
} else {
Serial.println("SD Card Fail");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment