Created
May 10, 2017 18:54
-
-
Save kinasmith/79f62b9fc9d48f2e71a1409789a28510 to your computer and use it in GitHub Desktop.
sd and clock and radio working in LOOP
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
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