hi just gone through the examples for my first program id like to learn how to latch an output ie push button o/p stays on push button output off could someone point me in the right direction please
thanks
Outputs are latched. You have to explicitly set the pin to HIGH or LOW. It does not automatically revert after some period.
I think the term you are looking for is that you want the outputs to TOGGLE.
It is rather easy to do -
declare a variable -
int toggleVar = 0;
inside of loop(){
int ButtonVal;
buttonVal = digitalRead(ButtonPin)
if (buttonVal = HIGH ) toggleVar= !toggleVar;
if (toggleVar) {
digitalWrite(outputPin,HIGH);
else
digitalWrite(outputPin,LOW);
}
}
I don't guarrantee my code will run as written, but it is an outline...
thanks for the help