An Example Flow for node-red-contrib-i2c-motorhat

An example flow for node-red-contrib-i2c-motorhat.

[{"id":"5ff6cb6d.fd4284","type":"tab","label":"Test","disabled":false,"info":""},{"id":"6decf22d.1af6bc","type":"function","z":"5ff6cb6d.fd4284","name":"Input Node","func":"controlMsg = {};\n\n// varialbles\ncontrolMsg[\"index\"] = 3;\ncontrolMsg[\"speed\"] = 250;\ncontrolMsg[\"command\"] = 1;\ncontrolMsg[\"runtime\"] = 2;\nreturn controlMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":300,"wires":[["a369e4c4.958818"]]},{"id":"a369e4c4.958818","type":"i2c DC Motor","z":"5ff6cb6d.fd4284","name":"","busno":"1","address":"96","x":670,"y":300,"wires":[[]]},{"id":"76ef2571.5dbabc","type":"inject","z":"5ff6cb6d.fd4284","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":300,"wires":[["6decf22d.1af6bc"]]},{"id":"8e2738b7.b50078","type":"i2c Stepper Motor","z":"5ff6cb6d.fd4284","name":"","busno":"1","address":"96","x":690,"y":380,"wires":[[]]},{"id":"21d8a1b2.ffa7be","type":"function","z":"5ff6cb6d.fd4284","name":"","func":"controlMsg = {};\n\n// varialbles\ncontrolMsg[\"index\"] = 2;\ncontrolMsg[\"speed\"] = 120;\ncontrolMsg[\"step\"] = 200;\ncontrolMsg[\"command\"] = 1;\ncontrolMsg[\"style\"] = 2;\nreturn controlMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":380,"wires":[["8e2738b7.b50078"]]},{"id":"647df597.9ff8cc","type":"inject","z":"5ff6cb6d.fd4284","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":380,"wires":[["21d8a1b2.ffa7be"]]},{"id":"5ac4485e.845a98","type":"i2c motor scan","z":"5ff6cb6d.fd4284","name":"","busno":"1","x":480,"y":220,"wires":[["9d2960e4.3d28b"],[]]},{"id":"b60077f9.6e2428","type":"inject","z":"5ff6cb6d.fd4284","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":220,"wires":[["5ac4485e.845a98"]]},{"id":"9d2960e4.3d28b","type":"debug","z":"5ff6cb6d.fd4284","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":220,"wires":[]}]

Flow Info

Created 3 years, 11 months ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x2)
  • inject (x3)
Other

Tags

  • node-red-contrib-i2c-motorhat
  • Motor
  • Raspberry
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option