News:

  • April 30, 2026, 03:51:53 PM

Login with username, password and session length

Author Topic: PEAKING  (Read 9178 times)

maciek

  • Sr. Member
  • ****
  • Posts: 95
PEAKING
« on: March 05, 2020, 08:32:00 PM »
is there an easy way take a reading for example of an analog input and capture the "peak" or the highest number that channel got to.
And if there is a highest number is there a way for capturing the lowest number
« Last Edit: March 05, 2020, 08:35:17 PM by maciek »

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
Re: PEAKING
« Reply #1 on: March 05, 2020, 09:45:51 PM »
Just do a compare A>B then set B=A if true where A is input and B is Peak.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: PEAKING
« Reply #2 on: March 05, 2020, 11:43:42 PM »
INIT N0 = 0
MATH N0 = max(N0, WX0)

INIT N1 = 32767
MATH N1 = min(N1, WX1)
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

maciek

  • Sr. Member
  • ****
  • Posts: 95
Re: PEAKING
« Reply #3 on: March 06, 2020, 10:13:46 PM »
thanks you guys are awesome.

maciek

  • Sr. Member
  • ****
  • Posts: 95
Re: PEAKING
« Reply #4 on: March 14, 2020, 12:36:12 PM »
adding to my first question is there a way of only reading the peak and when it falls below the peak it still shows the highest point.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: PEAKING
« Reply #5 on: March 14, 2020, 05:54:08 PM »
Use N0 in logic in place of WX0.  N0 is the peak value. Remember to have a way to reset the peak when appropriate.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

maciek

  • Sr. Member
  • ****
  • Posts: 95
Re: PEAKING
« Reply #6 on: March 28, 2020, 01:08:04 PM »
that worked out really well thanks