Shop OBEX P1 Docs P2 Docs Learn Events
Var long tc - write into EEPROM — Parallax Forums

Var long tc - write into EEPROM

 I am traying to, based in  the 05_jm-ds3231_demo and 06_jm_at24c32_demo, make a temperature
 datalogging for a window of time (for 15 minutes with sample time of 30 secunds, e.g.)
 however I am with the follow doubt:

 How do I do to put tc (rtc.temp_c) into eeprom  and setup a range of logging time?}

 Thanks in advance. 


  • It would be best to use the rtc to synchronize your when you want to write. Start by reading the seconds register, then test it with something like this:

      if (sc % 30 == 0)

    In the log_temp() method you'll need to read the temperature, the write it to the EE as a long using an index -- for example:

      tc := rtc.temp_c()
      ee.wr_long(tidx << 2, tc)

    The index variable, tidx, can be monitored for your until it hits 2x your desired time (given you're storing everything 30s)

    This should be enough to get you going.

Sign In or Register to comment.