Re: Keypad for Gated Entry

If you want to go to some extra trouble, you can squeeze your access log entries even further.

Presumably, you have a list of access codes in EEPROM, to check against the code they enter. When you log it, you don't need to save the whole access code. Just save the index of the code from the list.

For example, if the list of valid codes is:

  1. 123456
  2. 987654
  3. 743979

and they enter '987654', you would log '2', meaning the second entry in your list. (Of course, in 'C', array indices start with 0, but you get my meaning).

Unless you have more than 256 access codes, logging the access code this way will take up only one byte.

As to the time, if you don't need one-second accuracy, you can just log minutes. As mem said, use an offset since a particular date. For example, calculate the number of minutes since Jan 1, 2009 and store that number. If you do this, three bytes can store over thirty years of date stamps.

There are a few disadvantages to this time and date stamp method. You'll have to write your own routines to do the calculations, and you'll also have to write the routines to convert the 'elapsed minutes' numbers back to regular dates and times.

But, if you want to cram the maximum number of log entries into the smallest amount of space, that's one method.\

-Mike