ok so i am having a little trouble coding the sd card to check if sd card is not present... if sd card is not present, it will then set a time stamp.
if one was to put in a sd card in without powering the arduino off first it will check if the time has been pass 3 sec... is so it will display myGLCD.print("SD card found, Please power off then on for effect to take place", 0, 5);
that one scenario,
but lets say SD card is found then it will check to see if file exist on the sd card by doing SD.exists("files.txt"); if file doesnt exist it will then place a time stamp and display a message that will be as followed - myGLCD.print("Correct files do not exist on SD Card, Please power off then insert the correct SD card with the files then power the arduino back on for the effect to take place", 0, 5);
so i figure out most of the code just having issues with the time stamp part if any one can help...
here is what i have so far...
if (!check4sdc.init(SPI_HALF_SPEED, chipSelect)) {
myGLCD.setColor(0, 0, 0); //Sets color to Black
myGLCD.fillRect(0, 0, 319, 239); //Color the Background in black
myGLCD.setColor(255, 0, 0); //sets color to red
myGLCD.drawRect(5, 19, 314, 37); //Draws a Rect around the word below
setFont(LARGE, 255, 0, 0, 0, 0, 0); //Font set to big and font color to red with black BG
myGLCD.print("*No SD Card Found*", CENTER, 20); //Prints header with red Rect from above
myGLCD.print("1.", 12, 45); //labels steps to be display 1-3
myGLCD.print("2.", 12, 70);
myGLCD.print("3.", 12, 95);
myGLCD.print("*******************", CENTER, 120); //Warning header
myGLCD.print("***** WARNING *****", CENTER, 136);
myGLCD.print("*******************", CENTER, 152);
setFont(SMALL, 255, 0, 0, 0, 0, 0); // sets font to small with red font and black BG
myGLCD.print("Unplug All powers to the arduino.", 47, 49); //Print step 1
myGLCD.print("Insert Pre-Programed SD Card.", 47, 74); //Print step 2
myGLCD.print("Plug power back into the arduino.", 47, 99); //Print step 3
myGLCD.print("If power is not unplug when doing these", CENTER, 176); //Print warning message
myGLCD.print("steps, you risk damaging the main board", CENTER, 188);//Print warning message
myGLCD.print("& electric shocking your self.", CENTER, 200);} //Print warning message
else {
if (!SD.exists("files.txt")) { //If file doesnt exist..
setFont(SMALL, 255, 0, 0, 0, 0, 0); //set font to small, red font, black BG
myGLCD.print("files do not exists 12333", CENTER, 136);} //Displays message if file doesnt exist
else {
// do the rest of the sketch if everything checks out...
}
}
how would i add the time stamp into this code using the
unsigned long currentMillis = millis();
previousMillis
i think i might have just answer my self here lol i think i can figure it out now after writing all this
but i might be wrong... so lets go ahead and see if you guys can still help just in case i fail at it lol