Auto hold push button


#1

Hello,

I’m new to Mblock and I’m looking for information.
I would like to control lights with push buttons.
When I press a push button, the light turns on and stays on. when I press a second time the light goes out.

is to program an auto maintain. It is surely very simple but I can’t find it !! However I have already programmed automatic door openings and it works.

Thank you in advance for your help. And sorry for my English, I am French.


#2

The translations are not very clear. Can you tell us a few pictures?


#3

Besoin de plus d’information.

Est-ce qui’il y a un DEVICE en particulier ???
Juste nous envoyer un imprime écran de la solution.

Nous allons trouver mais si je suis plus sur mBlock5


#4

Simple binary variable to hold the state of your light. Set variable to 0, set light to off.
Loop
Wait for button press
If variable is 0, set it to 1 and switch light on
else set variable to 0 and switch light off
Go back to start of loop

Is that what you’re trying to do?


#5

I forgot to specify that it is for an arduino uno.

Thanks