very noob question about button tutorial


hi, i'm testing button code examples, , works, obviusly.
now i'm trying use high state of button.

if led low, , button high, turn on led, , keep on.
if led if high, , button high, turn off led, , keep off.

the problem (i think) 2 cases simultaneously. please me.

first need implement edge detector, trigger when button changes being low being high. means remembering previous state of button, last thing in loop function make copy of current button state in variable called lastbuttonstate. change state of led when last state low , current state high. have variable track last state set led to.


Arduino Forum > Using Arduino > Programming Questions > very noob question about button tutorial


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code