Shop OBEX P1 Docs P2 Docs Learn Events
Keep peak input value — Parallax Forums

Keep peak input value

Gunstar1Gunstar1 Posts: 18
edited 2009-02-07 17:43 in BASIC Stamp
I am working on a unit to monitor g-forces in a car using a BS2 and the Memsic 2125.· Good news is that I had no problems getting it to display the tilt and·g-force for·X and then modifying it to read Y and display them on the 2x16 serial LCD.

Found a flaw in the design... it's·hard to drive and read an LCD at the same time.

So, how can I temporarily keep the peak value?· I don't see anything in the commands that would do such a thing.· I don't really·need it to be a data logger, just hold on to the peak value until·a button is pressed (or a few seconds or·whatever pass).

Project based on N&V #92

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-02-07 05:15
    PeakValue = PeakValue MIN NewValue
    IF ButtonPressed THEN PeakValue = 0

    -Phil
  • Gunstar1Gunstar1 Posts: 18
    edited 2009-02-07 17:43
    Worked great...

    (though I read the MIN command I did not understand that it could do this until you posted)
Sign In or Register to comment.