Author Topic: Is there an easy way to compare two analog values with an Action?  (Read 719 times)

lewis3000us

  • Newbie
  • *
  • Posts: 5
I am looking for an easy way to us an Action to compare two analog values that I collect on two Channels.  I want the Action result to to be off while the analog value of Channel 1 is greater than the analog value of Channel 2.  And I want it to be on while Channel 1 is less than Channel 2.

Anyone know if there is a way to do this with an Action?

Thanks!

Tom
« Last Edit: August 25, 2009, 04:18:47 PM by lewis3000us »

jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • ioBridge.com
Re: Is there an easy way to compare two analog values with an Action?
« Reply #1 on: August 25, 2009, 01:04:13 PM »
I can't think of an easy way to do that with an action. But this is the perfect job for an op-amp wired as a voltage comparator.  (It's about the easiest thing you can do with an op-amp)

Here's an example:
http://www.softwareforeducation.com/electronics/notes/AS/OpAmp/741-Comparator.php

Jason Winters
ioBridge Developer

lewis3000us

  • Newbie
  • *
  • Posts: 5
Re: Is there an easy way to compare two analog values with an Action?
« Reply #2 on: August 25, 2009, 04:20:30 PM »
Thanks Jason.  I think you are right; just do it using a comparator.  I will mess around with it.