SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By AbolfazlNejatian
#195512
hey guys
I'm trying to build an attendance management system with a fingerprint.
and now I'm faced with this problem,
how to create a nested structure for my customer.
structure tree attached in the picture.
and please tell me the most efficient way to define my variable size(byte, int, long int and ...)
many thanks for your help
Abolfazl Nejatian
You do not have the required permissions to view the files attached to this post.
By Valen
#195513
There is no need to have the day,month,year, hour and minute to be individual fields. It could be much more usefull, or efficient in terms of memory use, to use this as a linear variable. Like Unix Epoch time, which is an integer number of seconds since new-years 1-1-1970 iirc. Or like Microsoft's Excel, the number of days since 1-1-1900, with the time of day as a fractional part. The fraction could also be in integer form, like the number of minutes in the day over the maximum of 1440. With the right formulas you can calculate what month, day or year that should be. Even what day of the week or time of day.

On the other hand, the C-language does have a means to store combined variables as records in a array.

Which way want to handle that depends on what you want to do with that information. What do you want to distill out of those statistics?
By AbolfazlNejatian
#195515
I'm trying to build an attendance management system with a fingerprint.
and now I'm faced with this problem,
I’ve 25 persons and I need to save their entrance time (year, month, hour, minutes) and their exit time (year, month, ...) and compare with their standard Enter/Exit time.
for example, for an imaginary guy like Jack, initially I’ve to set Entrance/Exit time in week. like this,
Sunday Monday .... Friday
Enter Exit Enter Exit .... Enter Exit
7AM 15PM 9AM 16PM .... 7AM 18PM
This is what he should come in an ordinary week.
And then in Sunday morning I’ve to register and save his coming time and so on!
So in this problem we need to sets of variables first one for recording standard time for any person and second of for every day Entrance/Exit Time.
And my question is how to define these set of variables????
Thank you for the time you spent reading my problem dear @Valen.
Best regard
Abolfazl Nejatian
By AbolfazlNejatian
#195516
Valen wrote: On the other hand, the C-language does have a means to store combined variables as records in a array.
would you please clear this up for me