newbie question Counting events
joecamaro68
Posts: 8
Hello I have a newbie question. I built a circuit that cycles a valve open and close. I would like to count each open close cycle and store this number in a variable. The question is, can I store this and retrieve later? I can not keep the stamp conected to my computer because I am also using a data loger to look at the event.
·
·
Comments
I did something similar (logged max and min temperatures in my well house) as my first useful project. Something that I learned: make sure that your power source is reliable. A battery (if it's the right one) is good, unless you are using a BS2px which draws a lot more current than some Stamps. Of course, my application had to run for a week at a time, and I took NO steps to conserve power, such as removing the pilot light. I use a separate program to read the stored data, but the Read routine can be written into the main logging program. I can bring the Stamp into the house and ask the PC to interrogate it. Did that through DEBUG
Just some food for thought,
Terry
Remember that locations in the EEPROM can be written a limited but large number of times (100,000 to 1,000,000). Don't WRITE to a location that already contains the value you want and that will help a lot.
As Mike says, the data will stay intact, as long as you don't inadvertently store it in space that the program will use, TheParallax inof on EEPROM usage is fairly clear, however...
Mike, I panicked when I first read about the limited number of WRITES that you could do. Then I did the math and discovered that It wouldn't be a problem in my application for 10-25 years or so. It will probably outlive me! I did make sure that I only save record highs and lows, however!
In many applications, the write limitations won't be a problem. If there's an error or poor design in your program though and it writes to the same location in EEPROM only ten times a second, that location will begin to wear out within a day (800,000+ writes).
I did wake up and realize that! (I first heard about this some ago by the way) Itis a good point to keep in mind when prototyping, however, and I appreciate that (I could see myself wondering why a program that worked yesterday quit today!)
Joecamaro, I think that I sorta hi-jacked your thread; sorreee!
Regards,
Terry
pro