S
S
StavrovDima2021-04-14 21:13:00
Raspberry Pi
StavrovDima, 2021-04-14 21:13:00

Node Red. traffic light model. Switch button how?

Hello! I found a tutorial on the Internet on how to create a simple traffic light using Node-Red for Raspberry PI.
Here it is: https://youtu.be/bkJuzFdnLUg
This is how my scheme looks like:
60772f1166691976967493.png
The functions Red, Red & Yellow, Green, Yellow contain Json values ​​that are passed to the output, respectively:
msg.payload = {"red": 1, "yellow": 0, "green": 0};
msg.payload = {"red": 1, "yellow": 1, "green": 0};
msg.payload = {"red": 0, "yellow": 0, "green": 1};
msg.payload = {"red": 0, "yellow": 1, "green": 0};
And in general, everything worked out, but now the task is to make 1 button for switching colors. Those. to reset the delay
Red + yellow => Green
Green => Yellow Yellow
=> Red

conditions for switching would be made. But nothing happened. I'm new to this software, so please help!
Thank you!
https://pantydev.s-ul.eu/KAvlO2qy here is the export flow

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
StavrovDima, 2021-04-14
@StavrovDima

No more, thanks to everyone who replied!
Json values ​​began to be passed through global.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question