Reply To: Sketch

About Forums Forum Sketch Reply To: Sketch

#886
MartinCork
Participant

Thanks for replying.

I came across triggerPoint alright, and thanks for the heads up on Pin change events only working inputs, I wasn’t aware of this.

I should have explained in my earlier post – the reason why I want to do this on the Arduino is because I cannot do it in the browser. I want to be able to make it do something like ‘if the value of this Potentiometer has not gone above 500 in the last 30 minutes, make the website do X’. So I want to write code something like this…

set Arduino PIN 13 to LOW
start 30 minute timer on Arduino
if Potentiometer goes above 500, reset timer
if timer reaches 30 minutes, set Arduino PIN 13 to HIGH
if the website that is connected to Arduino sees that PIN 13 is HIGH, do X

I can’t do this in the browser, because each time the page loads the timer will start at 0 (as I’m sure you know). (That said, I was trying to do it in the browser until a real programmer told me that it wouldn’t be possible.)

Maybe I’m overcomplicating things; is there a simple way to check the status of the digital pins of the Arduino?┬áSo then I could then the Potentiometer code that sets the digital Pin to HIGH, and if the website sees that digitalPin 13 is HIGH, then do X?