Reply To: Sketch
May 19, 2013 at 5:28 PM
#885
soundanalogous
Member
You only get Pin change events for inputs (such as buttons, potentiometers, etc). You should use an input (potentiometer) to drive an action, not an output (led). What you need to do is listen for a change event on the Potentiometer (or better yet use a triggerPoint filter – see Breakout/examples/filters/triggerpoint.html). When the threshold is crossed on the rising edge (transition of 0 -> 1 when using triggerpoint filter), set pin 13 to HIGH and do something on your website, when the threshold is crossed on the falling edge, set pin 13 to LOW. The triggerpoint filter is helpful in eliminating jitter that you can observe when using an analog input.