T4.1 Using SD Card data as a Queu list to do things at a certain hour and minute

Status
Not open for further replies.

ratki

Member
I am looking for some help in determining the best route to go forward. I do not have any code to post thus far.

Basic premise of the project is as follows:

I want to build a queue list on the SD card that will be compared against the real time, to trigger certain events at those times.

The SD card will have a text file that contains data which is basically an hour and minute and then two other "variables". Something like the format below, but can be formatted in the text file in any way that can be read and parsed easier. This could contain up to 100 or so different entries. This file will be written to the card using a text editor and then inserted into the Teensy.

12:00,3,2
15:30,4,1
18:15,3,4

Using the onboard RTC (probably synced to a timeserver over Ethernet), we keep track of the time with the Teensy and check to see if it matches a time in the data on the SD card. If the time matches, then the two variables are put into play in the program. As shown in the small data set, at 12:00 we would want to put 3 and 2 into the program in their appropriate spots to do what they do .

Should I read the entire file and place the values into arrays? Then search those arrays for values that match the current time on the Teensy to then carry out the program with the two variables.

Or do I go through the SD card every minute to see if any of the queus match the current time on the Teensy and then act upon that data line alone?

Seems to me that I would not want to keep accessing the card, that it would be best to get the data off of it from the beginning and be done.

Or is there a better way of handling this?

Look forward to hearing your suggestions.
 
Status
Not open for further replies.
Back
Top