Joystick/automatic returning slider

Hello everyone!
My name is Mees and I'm starting out with NodeRED.
For a small project I would like to controll a small RC car from the NodeRED dashboard.
I would like to either make these based on template nodes or (if needed) a custom node.

The idea is to controll forward/backwards motion with 1 joystick/slider and left/right motion with the other. The output should be continuous while touching the joystick/slider, but return to 0 on release. Basically like the regular RC remote controllers.

I tried using the standard sliders in NodeRED dashboard, but they wont allow me to both get continuous output and release detection.

Thanks in advance!!
Kind regards, Mees

There is these node that will trigger on keyboard and mouse events, not sure on touch screen.



You could possible use one to send payload 0 to input of slider when mouse/touch event released.

Edit/
You can get similar functionality to what you wish, with a trigger node and a change node. e.g.

[{"id":"87390807.c078b8","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = 0 ? payload : (payload < 0 ? payload + 1 : payload - 1))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":2580,"wires":[["3f251666.510f9a"]]},{"id":"78e9d10a.dfb168","type":"trigger","z":"8d22ae29.7df6d","name":"","op1":"","op2":"","op1type":"pay","op2type":"payl","duration":"250","extend":true,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":550,"y":2640,"wires":[["a8916d48.6b4c78"],["87390807.c078b8"]]},{"id":"3f251666.510f9a","type":"ui_slider","z":"8d22ae29.7df6d","name":"","label":"slider","tooltip":"","group":"165e1e1a.e752fa","order":4,"width":"6","height":"1","passthru":true,"outs":"all","topic":"letf/right","min":"-5","max":"5","step":1,"x":360,"y":2640,"wires":[["78e9d10a.dfb168"]]},{"id":"a8916d48.6b4c78","type":"debug","z":"8d22ae29.7df6d","name":"Na Template","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":600,"y":2520,"wires":[]},{"id":"8e65f74c.65599","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":170,"y":2680,"wires":[["3f251666.510f9a","ad38de4.f4a09a"]]},{"id":"7f5ed4af.79605c","type":"trigger","z":"8d22ae29.7df6d","name":"","op1":"","op2":"","op1type":"pay","op2type":"payl","duration":"250","extend":true,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":550,"y":2720,"wires":[["a8916d48.6b4c78"],["7fc6bea7.c13d78"]]},{"id":"ad38de4.f4a09a","type":"ui_slider","z":"8d22ae29.7df6d","name":"","label":"slider","tooltip":"","group":"165e1e1a.e752fa","order":5,"width":"1","height":"6","passthru":true,"outs":"end","topic":"forward/back","min":"-5","max":"5","step":1,"x":360,"y":2720,"wires":[["7f5ed4af.79605c"]]},{"id":"7fc6bea7.c13d78","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(payload = 0 ? payload : (payload < 0 ? payload + 1 : payload - 1))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":140,"y":2780,"wires":[["ad38de4.f4a09a"]]},{"id":"165e1e1a.e752fa","type":"ui_group","z":"","name":"Default","tab":"f9b58883.fa613","order":1,"disp":true,"width":"12","collapse":false},{"id":"f9b58883.fa613","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

You just have to keep tapping.

Thank you so much! This is really close to what I would like!
I think I should be able to adjust it according to my wishes.

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