I'm trying to do a simple thing: Open and close a digital output on a Phidget board. The command is setState(state) and this is what the API says about it:
State will dictate whether the output is constantly high (TRUE) or low (FALSE).
- This will override any
DutyCyclethat may have been set on the channel.
- Setting the
Stateto TRUE is the same as setting
DutyCycleto 1.0, and setting the
Stateto FALSE is the same as setting a
State(type: Boolean):The state value
A Promise. Errors reject promise with a PhidgetError. Success resolves promise with the following:
No value is returned
But I just can't get it to work, probably because I suck at programming. I can do simple Python and a bit more advanced LUA, but no JSON. I have tried to inject with this in a function node:
msg.topic = 'setState'; msg.payload = true; return msg;
And I've tried to put setState as a string in the inject node and true as the JSON payload, but both of these gives me the same answer: "missing value" Can somebody please have a short look at this (I'm assuming it's easy for somebody who actually knows what they're doing!) and tell me what to do?
And here's a Readme for the node: https://www.npmjs.com/package/node-red-contrib-phidget22