Control robot arm with on / off button

I have a robot arm with 4 servos and I want to use an on / off button to start a process. I found several examples of flows where they use a slide bar to individually control each servo. My question is can I use a button to start the process until I turn off that button?

How does the robot talk to the NR controller ?

Create a dashboard page, insert a Button, have it send a command on a MQTT topic.

In your Flow - monitor that topic and then send out the commands to the 4 servos on other MQTT topics

Have a 2nd button on the dashboard that does the opposite to stop the robot

This all assume of course that your robot is able to be spoken to by MQTT

Thanks I will try that.
I am using an Esp8266, MQTT and Node-RED.
Another question, I have to put an MQTT theme for each servo even if it is a single process but that includes each servo separately?

No you could have a single MQTT topic and have your code on the ESP8266 turn off/on all the servos at one depending on what you receive

Are you writing your own code for the ESP8266 or using one of the prebuilt firmwares ?

Depending on what level of PMW/Stepping you are trying to do on the ESP8266 i do not think you will be able to control 4 servos

It may be worthwhile looking at a dedicated servo controller/board that connects to the ESP8266


I've used this servo controller board with a Wemos D1 Mini (ESP8266) flashed with ESP-Easy.

The basic PWM function (using ESP Easy) is limited to controlling two servos, so this external board gets over that limitation. There are drivers on the 'Devices' tab (within ESP-Easy) so implementation should be simple.

The arduino code I am doing based on some examples but using the slider and the original code of MQTT_esp8266, what I am trying to do is that when the switch button receives a 1 it starts the process of the robot arm and when it is a 0 it stops.

I decided to do it this way because I could do it with Blynk, but this is just the beginning of my programming, then I went to add sensors and other motors, and the blynk no longer supported me for that.

As Dave has said above - go to a precompiled image (EspEasy) and use the board above (presuming that it is adequate for the servos you are driving)