Executing several commands in sequence

hello,

Im trying to controll a tello drone with node red. i can use commands like "move forward 50 cm" or "move xyz" etc.

still i want to execute several commands in sequence with one "click". i want to have a dashboard button that i can click and then the drone flies e.g. 50 cm forward and then 50 cm to the left. how do i realise this?

thanks in advance

Hi. you could put all commands in an array then split array and rate limit.
e.g.

[{"id":"c3d17baa.336608","type":"inject","z":"c74669a0.6a34f8","name":"multi command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"move forward 50cm\", \"move right  50 cm\", \"move back 100cm\"]","payloadType":"json","x":180,"y":660,"wires":[["1a8ededc.007151"]]},{"id":"1a8ededc.007151","type":"split","z":"c74669a0.6a34f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":660,"wires":[["6770779e.c38b3"]]},{"id":"6770779e.c38b3","type":"delay","z":"c74669a0.6a34f8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":660,"wires":[["f3880de1.60f03"]]},{"id":"30c8fbef.3d9d2c","type":"inject","z":"c74669a0.6a34f8","name":"single command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"move forward 50cm\"]","payloadType":"json","x":200,"y":700,"wires":[["1a8ededc.007151"]]},{"id":"f3880de1.60f03","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":660,"wires":[]}]
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.