Need a push button node

I need a kind of push button node in which if i push it it will output 1 and if i release it will output 0

Try:

[{"id":"8d09f358.cc5c4","type":"ui_template","z":"1d85b106.5dfcd7","group":"2452ebe2.f30164","name":"Up","order":6,"width":2,"height":1,"format":"<button ng-mousedown=\"send({payload: 'down'})\" ng-mouseup=\"send({payload: 'up'})\"><i class=\"material-icons\"> volume_up </i></button>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":130,"y":330,"wires":[["26653ac7.751afe"]]},{"id":"2452ebe2.f30164","type":"ui_group","z":"","name":"Audio","tab":"39b306a2.96619a","order":1,"disp":true,"width":6,"collapse":false},{"id":"39b306a2.96619a","type":"ui_tab","z":"","name":"TV remote control","icon":"dashboard","order":45,"disabled":false,"hidden":false}]

Note:
In Andrew's flow, you'll need to change the Send() values from 'down' and 'up' to '1' and '0'.

Ah, yes. Sorry.

I was torn between fixing it to be 1 and 0 or leaving it as is.

It works. I changed the values to 1 and 0. Thank you very much can you say how can i change the Icon?

Ok, the icon is in this part:

<i class="material-icons"> volume_up </i>

So that is the material design icon set.

There is also font awesome.

Links:

https://fontawesome.com/v4.7.0/icons/

Find what you want and put the name as needed.

If using fontawesome, the syntax is slightly different.

<i class="fa fa-arrow-up fa-2x"></i>

Hope that helps.

1 Like