Shop OBEX P1 Docs P2 Docs Learn Events
Retrieving highest and lowest value. — Parallax Forums

Retrieving highest and lowest value.

mademoisellemademoiselle Posts: 10
edited 2012-02-16 05:00 in BASIC Stamp
Hi, I'm new to BASIC Stamp and i need to do a project on recording temperature and retrieve/show the highest and lowest value on my debug terminal when i sense the temperature with my thermistor.Does anybody have any idea on how to do it or samples to assist me to receive such results? thanks alot for your kind help (:

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2012-02-14 09:50
    Think about how the program will work:
    0. Set a variable called Lotemp at 255. Set another variable called Hitemp at 0
    1. take a temperature reading.
    2. If its higher than Hitemp, store that value in Hitemp.
    3. if its lower than Lotemp, store that value in Lotemp.
    4.Goto Step 1
  • mademoisellemademoiselle Posts: 10
    edited 2012-02-14 20:05
    my program is going to test to temperature, receive it and store it next when the temperature changes it will compare with th temp taken and see which is the highest and then display it out. but know i do not know how do i prog it to store all my temperatures.
  • stamptrolstamptrol Posts: 1,731
    edited 2012-02-15 06:06
    From your post, it looks like you are interested in only the highest and lowest temperatures. That is the variable Lotemp and Hitemp. They always hold the current temerature extremes.

    If you also want to log each reading, use WRITE to store the value in EEPROM. In a Stamp, you don't have much room to store data, (2K, less the length of your program) and after thousands of writes the EEPROM will eventually wear out. Choose how often you WRITE carefully.
  • mademoisellemademoiselle Posts: 10
    edited 2012-02-15 19:14
    but by using EEPROM i got to use another IC , is there any other possibility i could just first save the first value then after when i read the second value i compare with the first value and do not save the first value anymore? thanks.
  • stamptrolstamptrol Posts: 1,731
    edited 2012-02-16 05:00
    No, the EEPROM is already in the Stamp.

    As pointed out in the other thread you've got running, have a look at the WRITE and READ commands in the Helpfile.
Sign In or Register to comment.