Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is the current code, that I am having the issue.
- [code]/* ==============================================================================================================================================================================================
- IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- INCLUDE
- IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- ==============================================================================================================================================================================================
- */
- /* IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- INCLUDE - SD CARD
- IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- */
- // ========== SD Card ======================================================
- #include <SD.h> // Needed to read/write to the SD Card
- const int chipSelect = 4;
- File myFile; // to handle to temperature tp160110.txt files
- File webFile; // to handle to Extron Output00.htm files
- /* IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- INCLUDE - Ethernet
- IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- */
- // ========== Ethernet Card ======================================================
- #include <SPI.h> // Needed to us the 6 special pins for the eithernet card
- #include <Ethernet.h> // Needed to use the eithernet card
- // ========== Ethernet Parameters ======================================================
- // comment out next line to write to SD from FTP server
- #define FTPWRITE
- #define error(s) error_P(PSTR(s)) // Make sure this is below #include <SD.h> or else there will be an error.
- // this must be unique
- byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xC1, 0xDE };
- // change to your network settings
- byte ip[] = { 10, 0, 0, 88 };
- byte gateway[] = { 10, 0, 0, 1 };
- byte subnet[] = { 255, 255, 255, 0 };
- byte dnsserver[] = { 10, 0, 0, 1 };
- // change fileName to your file (8.3 format!)
- //char fileName[13] = "day00.txt";
- //char fileName[13] = "TP150826.TXT"; // Capital letters need to match. or else it will upload as written. eqrunner is finicky about capitals vs lower case // not needed as we already have templog_filename
- char ftpserver[] = "XXXXXXXXXXXX.com"; // url of the server
- char ftpuserName[] = "USER XXXXXXXX"; // Make sure it includes the USER lead in: "USER admin"
- char ftppassWord[] = "PASS XXXXXXXXX"; // Make sure it has the PASS lead also: "PASS kittykat"
- char file_name[13]; // For startFTP. To define the file that will be uploaded
- char *file_folder; // For startFTP. To define the folder that the file_name will be uploaded to
- char outBuf[128];
- char outCount;
- EthernetServer server(80); // allows the arduino to be a server. to 'host' a file
- EthernetClient client; // the basic ground work to allow the arduino to be a client 'user'
- EthernetClient dclient; // needed for the doFTP stuff
- // ========== EMAIL ======================================================
- char email_server[] = "www.eqrunner.com"; // Setup for server to email me.
- boolean email_ip_run = 0; // True/False statement to only run the "email ip address" once.
- /* IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- INCLUDE - RTC Real Time Clock
- IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
- */
- #include "Wire.h" // Needed for RTC Chip
- #define DS1307_ADDRESS 0x68 // RTC Address.
- // char timestamp[27]; // Sets up the 28 char count for the write to SD card line. EX: char timestamp[27] = ("2015-07-01 WED 12:31 </br>");
- // [new Date(2015,08,25,00,01,58), 78.61 , 82.02 , -95.94 , 95.81 , -5.34 , 76.20 ],
- // [[00,00,22], 8.56 , 7.16 , 6.60 , 43.38 , 58.65 , 0.00 ],
- // Do you think this is nessassary? just print each item individualy. line by line. Takes up less ram to do.
- // ========== Temperature Sensor ======================================================
- char time_format [9]; // This is the character string for current time ( HH,mm,SS)
- char date_format [9]; // This is the character string for current date ( YY,MM,DD)
- char templog_filename [13]; // This is the character string for the file name tpYYMMDD.txt
- // ========== Mail Box ======================================================
- char timestamp[27]; // Sets up the 28 char count for the write to SD card line. EX: char timestamp[27] = ("2015-07-01 WED 12:31 </br>");
- /* ==============================================================================================================================================================================================
- SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- SETUP
- SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- ==============================================================================================================================================================================================
- */
- void setup() {
- // put your setup code here, to run once:
- /* SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- SETUP - Serial Port
- SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- */
- // Open serial communications and wait for port to open:
- Serial.begin(9600);
- while (!Serial) {
- ; // wait for serial port to connect. Needed for Leonardo only
- }
- /* SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- SETUP - SD Card
- SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- */
- Serial.print("Initializing SD card...");
- // see if the card is present and can be initialized:
- if (!SD.begin(chipSelect)) {
- Serial.println("Card failed, or not present");
- //LED_power_loop(0);
- //LED_sdcard_loop(0);
- // don't do anything more:
- return;
- }
- Serial.println("card initialized.");
- /* SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- SETUP - Ethernet
- SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- */
- // == SETUP ============ ETHERNET ============
- // Ethernet.begin(mac, ip);
- Ethernet.begin(mac, ip, dnsserver, gateway, subnet);
- /*
- if (Ethernet.begin(mac) == 0) {
- Serial.println("Failed to configure Ethernet using DHCP");
- LEDethernetStatus = 3; // IF it can not, it will show as as failed.
- // no point in carrying on, so do nothing forevermore:
- // try to congifure using IP address instead of DHCP:
- Ethernet.begin(mac, ip, dnsserver, gateway, subnet);
- }
- */
- Serial.print("IP Address: ");
- for (byte thisByte = 0; thisByte < 4; thisByte++) {
- // print the value of each byte of the IP address:
- Serial.print(Ethernet.localIP()[thisByte], DEC);
- Serial.print(".");
- }
- Serial.println();
- Serial.print("SubnetMask: ");
- for (byte thisByte = 0; thisByte < 4; thisByte++) {
- // print the value of each byte of the IP address:
- Serial.print(Ethernet.subnetMask()[thisByte], DEC);
- Serial.print(".");
- }
- Serial.println();
- Serial.print("Gateway: ");
- for (byte thisByte = 0; thisByte < 4; thisByte++) {
- // print the value of each byte of the IP address:
- Serial.print(Ethernet.gatewayIP()[thisByte], DEC);
- Serial.print(".");
- }
- Serial.println();
- Serial.print("DNS: ");
- for (byte thisByte = 0; thisByte < 4; thisByte++) {
- // print the value of each byte of the IP address:
- Serial.print(Ethernet.dnsServerIP()[thisByte], DEC);
- Serial.print(".");
- }
- Serial.println();
- server.begin();
- //printDate(); // Parses the Current date and time once. // Commented out since This does not need to run so soon.
- // ButtonUpload_count = 0; // Resets Button Upload count to 0, cause printDate() counts to 53.
- //email_ip(); // Runs email_ip to send me an email of its current ip // Commented out since I don't need it as it is home now. Not on some site.
- /* SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- SETUP - RTC - Real Time Clock
- SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
- */
- Wire.begin(); // sets up the 'wire' code to be able to read the RTC
- }
- /* ==============================================================================================================================================================================================
- LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
- LOOP
- LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
- ==============================================================================================================================================================================================
- */
- void loop() {
- // put your main code here, to run repeatedly:
- /* LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
- LOOP - SERIAL activated Actions
- LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
- */
- // == LOOP ============ SERIAL INPUT ====================================
- // TESTING: If F is entered into the serial widow, then it will execute an ftp upload
- byte inChar;
- inChar = Serial.read();
- if (inChar == 't')
- {
- // Testing Character
- startFTP("templog_action");
- }
- }
- /* ==============================================================================================================================================================================================
- ==============================================================================================================================================================================================
- SERVER
- ==============================================================================================================================================================================================
- ==============================================================================================================================================================================================
- */
- // =====================================================================================================================
- // ============ FTP UPLOAD =============================================================================================
- // =====================================================================================================================
- // ========== STEP 1 - Define which file ======================================================
- void startFTP(char which_action[]) {
- Serial.println("startFTP activated. ");
- int startFTP_ready = 0;
- // ========== STEP 2 - Setup variables for specified file type ======================================================
- if (which_action == "templog_action") {
- Serial.println("Temp Log Action Activated");
- sprintf(file_name, templog_filename); // have to build it as a sprintf for some stuipd reason. Other than templog_filename is a sprintf
- // sprintf(file_folder ,"cwd temperature");
- //startFTP_ready = 1;
- }
- if (which_action == "phpdaily_action") {
- Serial.println("PHP Daily Action Activated");
- }
- if (which_action == "maillog_action") {
- Serial.println("Mail Log Action Activated");
- }
- if (which_action == "comcastlog") {
- Serial.println("Mail Log Action Activated");
- }
- if (startFTP_ready == 1) {
- if (doFTP()) {
- Serial.println(F("FTP OK")); // executes the doFTP code to upload on the Ethernet tab. Will return FTP OK if it worked
- //wdt_enable(WDTO_4S);
- //LED_ethernet_loop(1);
- }
- else {
- //wdt_enable(WDTO_4S);
- //LED_ethernet_loop(3);
- }
- }
- Serial.println(file_name);
- Serial.println(file_folder); // This wont render correctly???
- Serial.println("startFTP END");
- // Activate the FTP upload -> Step 3
- }
- // ========== STEP 3 - Upload Said file ======================================================
- byte doFTP() // Is a byte. If below completes successfully, it returns with a 1. if it fails, it returns with a 0
- {
- Serial.print("FTP Started....");
- //digitalWrite(LEDethernetRed, HIGH);
- //wdt_disable(); // Stops the watchdog as this may take more than 4 seconds
- myFile = SD.open(file_name, FILE_READ); // Opens up the file for reading (1st of 2 connections open)
- if (!myFile)
- {
- Serial.println(F("SD open fail"));
- return 0;
- }
- if (client.connect(ftpserver, 21)) { // Opens up FTP server (2nd of 2 connections open) Just like FTP> open eqrunner
- //Serial.println(F("Command connected"));
- }
- else { // If there is a fail, it returns with a 0 = fail
- client.stop();
- myFile.close();
- Serial.println(F("Command connection failed"));
- return 0;
- }
- if (!eRcv()) return 0; // Waits for server to finish sending me all of it's welcome text. User (eqrunner.com:(none)): When it is completed then...
- client.println(ftpuserName); // Sends preset user name.Example: FTP> USER admin
- if (!eRcv()) return 0; // Waits for server to finish sending back info Example: 331 User admin OK. Password required. Password:
- client.println(ftppassWord); // Sends preset password .Example: FTP> PASS kittykat
- if (!eRcv()) return 0;
- client.println(F("SYST")); // Asks server for System identification type. Example UNIX Type: L8.
- if (!eRcv()) return 0;
- client.println(F("Type I")); // Sets the type of file to be transferred. Type I = image (binary data)
- if (!eRcv()) return 0;
- client.println(F("PASV")); // Tells the server to enter 'passive mode'
- if (!eRcv()) return 0;
- char *tStr = strtok(outBuf, "(,"); // have no clue?
- int array_pasv[6];
- for ( int i = 0; i < 6; i++) {
- tStr = strtok(NULL, "(,");
- array_pasv[i] = atoi(tStr);
- if (tStr == NULL)
- {
- Serial.println(F("Bad PASV Answer"));
- }
- }
- unsigned int hiPort, loPort;
- hiPort = array_pasv[4] << 8;
- loPort = array_pasv[5] & 255;
- //Serial.print(F("Data port: "));
- hiPort = hiPort | loPort;
- //Serial.println(hiPort);
- //if (dclient.connect(server, hiPort)) {
- if (dclient.connect(ftpserver, hiPort)) {
- //Serial.println(F("Data connected"));
- }
- else {
- Serial.println(F("Data connection failed"));
- client.stop();
- myFile.close();
- return 0;
- }
- // IF it got this far, then All is well and ready to upload
- client.println(F("cwd temperature")); // Change Directory to /temperature/ cwd acts the same as cd in ftp>
- //client.println(file_folder); // Change Directory to /temperature/ cwd acts the same as cd in ftp>
- if (!eRcv()) return 0; // wait for the responce back.
- client.print(F("STOR ")); // Buildng the client.println to do the following: ftp> STOR tp20150826.txt
- client.println(file_name); // STOR is the raw version of 'put' in ftp> language
- if (!eRcv())
- {
- dclient.stop();
- return 0;
- }
- //Serial.println(F("Writing")); // Begins writing the file to the server, one byte at a time
- byte clientBuf[64];
- int clientCount = 0;
- while (myFile.available())
- {
- clientBuf[clientCount] = myFile.read();
- clientCount++;
- if (clientCount > 63)
- {
- dclient.write(clientBuf, 64);
- clientCount = 0;
- }
- }
- if (clientCount > 0) dclient.write(clientBuf, clientCount);
- dclient.stop();
- //Serial.println(F("Data disconnected"));
- // END of writing the file to the server.
- if (!eRcv()) return 0; // wait for the responce back.
- // Okey We are complete with the upload. Lets end this ftp>
- client.println(F("QUIT")); // Send quit command to quit to log off and end ftp connection
- if (!eRcv()) return 0; // wait for the responce back.
- client.stop(); // Close ethernet connection that was opened at the start of this.
- //Serial.println(F("Command disconnected"));
- myFile.close(); // Close the SD card connection that was opened at the start of this.
- //Serial.println(F("SD closed"));
- return 1;
- }
- // ---------------------------------------------------------------------------------------------------------------------------------
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // - - - - - - - - - - e Recieve. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // Reads each byte sent from the server.
- // Checks byte from server Makes sure it is ok if so, returns with a 1 saying all is well.
- byte eRcv()
- {
- byte respCode;
- byte thisByte;
- int timeout = 0; // Creates a time out interger. Should there be a issue and it cant connect.
- //wdt_reset();
- while (!client.available()) { // Asking, While client is NOT availible (Say outside internet is down) ....
- //Serial.print(".");
- delay(5); // Waits 5 miliseconds. tries again
- timeout++; // increases the timeout count every time.
- if (timeout > 1000) { // If the timeout count gets to 10000 Then...
- Serial.print("INFINITE LOOP BREAK!"); // Serial Prints out that the client could not connect. and...
- return 0; // returns the eRec(0) thus ending the connection and exiting out and returning back to the void loop.
- }
- }
- respCode = client.peek();
- outCount = 0;
- while (client.available())
- {
- thisByte = client.read();
- // - - - - - - - - - - - - - - -
- // Serial.write(thisByte); // Spits out each responce back from godaddy.
- // - - - - - - - - - - - - - - -
- if (outCount < 127)
- {
- outBuf[outCount] = thisByte;
- outCount++;
- outBuf[outCount] = 0;
- }
- }
- if (respCode >= '4')
- {
- efail();
- return 0;
- }
- return 1;
- }
- // ---------------------------------------------------------------------------------------------------------------------------------
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // - - - - - - - - - - eFAILED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- void efail()
- {
- byte thisByte = 0;
- client.println(F("QUIT"));
- while (!client.available()) delay(1);
- while (client.available())
- {
- thisByte = client.read();
- Serial.write(thisByte);
- }
- client.stop();
- Serial.println(F("Command disconnected"));
- myFile.close();
- Serial.println(F("SD closed"));
- }
- // ---------------------------------------------------------------------------------------------------------------------------------
- /* ==============================================================================================================================================================================================
- ==============================================================================================================================================================================================
- RTC - Real Time Clock Get Time
- ==============================================================================================================================================================================================
- ==============================================================================================================================================================================================
- */
- // - - - - - - - - - - RTC - Real Time Clock Get time - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- byte bcdToDec(byte val) {
- // Convert binary coded decimal to normal decimal numbers
- return ( (val / 16 * 10) + (val % 16) );
- }
- void printDate() {
- // Reset the register pointer
- Wire.beginTransmission(DS1307_ADDRESS);
- byte zero = 0x00;
- Wire.write(zero);
- Wire.endTransmission();
- Wire.requestFrom(DS1307_ADDRESS, 7);
- int second = bcdToDec(Wire.read());
- int minute = bcdToDec(Wire.read());
- int hour = bcdToDec(Wire.read() & 0b111111); //24 hour time
- int weekDay = bcdToDec(Wire.read()); //0-6 -> sunday - Saturday
- int monthDay = bcdToDec(Wire.read());
- int month = bcdToDec(Wire.read());
- int year = bcdToDec(Wire.read());
- char * DayOfWeek[8] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" , "SUN"};
- /*
- //print the date EG 3/1/11 23:59:59
- Serial.print(month);
- Serial.print("/");
- Serial.print(monthDay);
- Serial.print("/");
- Serial.print(year);
- Serial.print("-");
- char * DayOfWeek[8] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" , "SUN"};
- //Serial.print(weekDay);
- Serial.print(DayOfWeek[weekDay]);
- Serial.print(" ");
- Serial.print(hour);
- Serial.print(":");
- Serial.print(minute);
- Serial.print(":");
- Serial.println(second);
- */
- //char date_format [9];
- sprintf(date_format, "%02d-%02d-%02d", year, month, monthDay ); // builds up the date format
- // char time_format [9];
- sprintf(time_format, "%02d,%02d,%02d", hour, minute, second ); // builds up the time format
- sprintf(templog_filename, "tp%02d%02d%02d.txt", year, month, monthDay );
- /*
- Serial.print("FILE: ");
- Serial.print(filename_format);
- Serial.print(" DATE: ");
- Serial.print(date_format);
- Serial.print(" ");
- Serial.print(DayOfWeek[weekDay]);
- Serial.print(" ");
- Serial.println(time_format);
- */
- //Serial.println(time_format);
- //Serial.println(time_format[7]); // Even thou it is buffered at 9, only 7 values are used starting with 0. HH is 0 and 1, MM is 3 and 4. SS is 6 and 7)
- //char * DayOfWeek[8] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" , "SUN"}; // Setup so you can convert the 'weekDay' to a alpha value
- //sprintf(timestamp, "20%d-%02d-%02d %s %02d:%02d </br>", year, month, monthDay, DayOfWeek[weekDay], hour, minute); // Lays out the sprintf( define the char string, "the format and types of values" , each value)
- //Serial.println( F("TIME: ") );
- //Serial.println( timestamp );
- }
- // - - - - - - - - - - RTC - Real Time Clock Get time - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement