You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • I'd love to see your write up if you get that working.

    I tried it out and it's dead simple - Connect up LM339 to +3.3 and gnd, and pick one of the 4 comparators in it... Output goes to the pin you'll setWatch() on, one input goes to a reference voltage (you can make these with analogWrite() to the DAC pins), and the other input is the analog voltage you're reacting to. When the In+ is at a higher voltage than In-, the output goes high. For reasons not immediately clear to me, in my testing, I had to use the debounce option on setWatch(), otherwise the watch would be triggered repeatedly while the output was high. I'm sure there are improvements that can be made to this, but this should give you enough to get started with (since I'm not sure when I'll have a chance to write up the doc nicely - I'd like to include in the doc a "change detector" setup, for use with those 20 cent chinese vibration "sensors").

About

Avatar for DrAzzy @DrAzzy started