Hello there;
First, I apologize for the bad english.
I have an application and I'm creating an excel table like the one below. I would like to open and close the relay with the arduino at the lines found in the lines in the text column. these data are in an SD card and connected to the arduino and also connected to the RTC. Thank you very much in advance
(sample excell)
NO hour min TEXT
ONN 001 00 00 ONN001=00:10
OFF 001 00 10 OFF001=00:11
ONN 002 00 30 ONN002=00:12
OFF 002 00 45 OFF002=00:14
ONN 003 01 00 ONN003=01:00
OFF 003 02 00 OFF003=02:00
ONN 004 00 00 ONN004=00:00
OFF 004 00 00 OFF004=00:00
ONN 005 00 00 ONN005=00:00
OFF 005 00 00 OFF005=00:00
ONN 006 00 00 ONN006=00:00
OFF 006 00 00 OFF006=00:00
ONN 007 00 00 ONN007=00:00
OFF 007 00 00 OFF007=00:00
ONN 008 00 00 ONN008=00:00
OFF 008 00 00 OFF008=00:00
ONN 009 00 00 ONN009=00:00
OFF 009 00 00 OFF009=00:00
ONN 010 00 00 ONN010=00:00
OFF 010 00 00 OFF010=00:00
ONN 011 00 00 ONN011=00:00
OFF 011 00 00 OFF011=00:00
ONN 012 00 00 ONN012=00:00
OFF 012 00 00 OFF012=00:00
ONN 013 00 00 ONN013=00:00
OFF 013 00 00 OFF013=00:00
ONN 014 00 00 ONN014=00:00
OFF 014 00 00 OFF014=00:00
ONN 015 00 00 ONN015=00:00
OFF 015 00 00 OFF015=00:00
ONN 016 00 00 ONN016=00:00
OFF 016 00 00 OFF016=00:00
ONN 017 00 00 ONN017=00:00
OFF 017 00 00 OFF017=00:00
ONN 018 00 00 ONN018=00:00
OFF 018 00 00 OFF018=00:00
ONN 019 00 00 ONN019=00:00
OFF 019 00 00 OFF019=00:00
ONN 020 00 00 ONN020=00:00
OFF 020 00 00 OFF020=00:00
ONN 021 00 00 ONN021=00:00
OFF 021 00 00 OFF021=00:00
ONN 022 00 00 ONN022=00:00
OFF 022 00 00 OFF022=00:00
ONN 023 00 00 ONN023=00:00
OFF 023 00 00 OFF023=00:00
ONN 024 00 00 ONN024=00:00
OFF 024 00 00 OFF024=00:00
ONN 025 00 00 ONN025=00:00
OFF 025 00 00 OFF025=00:00
ONN 026 00 00 ONN026=00:00
OFF 026 00 00 OFF026=00:00
ONN 027 00 00 ONN027=00:00
OFF 027 00 00 OFF027=00:00
ONN 028 00 00 ONN028=00:00
OFF 028 00 00 OFF028=00:00
ONN 029 00 00 ONN029=00:00
OFF 029 00 00 OFF029=00:00
ONN 030 00 00 ONN030=00:00
OFF 030 00 00 OFF030=00:00
ONN 031 00 00 ONN031=00:00
OFF 031 00 00 OFF031=00:00
ONN 032 00 00 ONN032=00:00
OFF 032 00 00 OFF032=00:00
ONN 033 00 00 ONN033=00:00
OFF 033 00 00 OFF033=00:00
ONN 034 00 00 ONN034=00:00
OFF 034 00 00 OFF034=00:00
ONN 035 00 00 ONN035=00:00
OFF 035 00 00 OFF035=00:00
ONN 036 00 00 ONN036=00:00
OFF 036 00 00 OFF036=00:00
ONN 037 00 00 ONN037=00:00
OFF 037 00 00 OFF037=00:00
ONN 038 00 00 ONN038=00:00
OFF 038 00 00 OFF038=00:00
ONN 039 00 00 ONN039=00:00
OFF 039 00 00 OFF039=00:00
ONN 040 00 00 ONN040=00:00
OFF 040 00 00 OFF040=00:00
ONN 041 00 00 ONN041=00:00
OFF 041 00 00 OFF041=00:00
ONN 042 00 00 ONN042=00:00
OFF 042 00 00 OFF042=00:00
ONN 043 00 00 ONN043=00:00
OFF 043 00 00 OFF043=00:00
ONN 044 00 00 ONN044=00:00
OFF 044 00 00 OFF044=00:00
ONN 045 00 00 ONN045=00:00
OFF 045 00 00 OFF045=00:00
ONN 046 00 00 ONN046=00:00
OFF 046 00 00 OFF046=00:00
ONN 047 00 00 ONN047=00:00
OFF 047 00 00 OFF047=00:00
ONN 048 00 00 ONN048=00:00
OFF 048 00 00 OFF048=00:00
ONN 049 00 00 ONN049=00:00
OFF 049 00 00 OFF049=00:00
ONN 050 00 00 ONN050=00:00
OFF 050 00 00 OFF050=00:00
Read it line by line, break up at the white space(basic string manipulation) and put the results in an array, 2D array would work best for this. You can save a lot of space by dropping the columns you don't care about and using a byte rather than int for the on/off, hour and minute values. You could even squeeze the whole thing into a single 16-bit int (one bit for the on/off state; the rest for the minute-of-the-day).
After that just loop through that array and if time has come for a certain action, do it.
By the way, the TEXT field doesn't seem to match the info of the hour and min fields.
wvmarle:
Plenty of examples on how to read from SD card.
Read it line by line, break up at the white space(basic string manipulation) and put the results in an array, 2D array would work best for this. You can save a lot of space by dropping the columns you don't care about and using a byte rather than int for the on/off, hour and minute values. You could even squeeze the whole thing into a single 16-bit int (one bit for the on/off state; the rest for the minute-of-the-day).
After that just loop through that array and if time has come for a certain action, do it.
By the way, the TEXT field doesn't seem to match the info of the hour and min fields.