Well, in the first instance, I'd drag in a 'function' block and add the following code inside it:
msg.payload = `Alert, the button was pressed. This is the ${msg.payload} press since power cycle.`;
return msg;
And for the second option, you can use flow.get/set:
Add a function block to the battery message
flow.set('battery', msg.payload);
return msg;
Add a function block to the click message:
msg.payload = `Alert, the button was pressed. This is the ${msg.payload} press since power cycle. Battery level is ${flow.get("battery")}`;
return msg;
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well, in the first instance, I'd drag in a 'function' block and add the following code inside it:
And for the second option, you can use
flow.get/set
:Add a function block to the battery message
Add a function block to the click message:
Hope that helps!