GuanyiLi-Craig / node-red-contrib-i2c-motorhat

Node-red nodes communicate with the Raspberry Pi I2C Motor Hat
MIT License
1 stars 2 forks source link

node-red-contrib-i2c-motorhat

Node-red nodes communicate with the Raspberry Pi I2C Motor Hat

Nodes Introduction

i2c motor scan

Return a list of addresses of i2c devices connected to raspebrry pi.

i2c DC motor

Node config:

Node input:

example input node - 4th DC motor runs for 2 seconds with 250/255 of full speed and forward direction.

controlMsg = {};

// varialbles
controlMsg["index"] = 4;
controlMsg["speed"] = 250;
controlMsg["command"] = 1;
controlMsg["runtime"] = 2;
return controlMsg;

image

Output:

Error msg.

i2c Stepper motor

Node config

Node input

example input node

controlMsg = {};

// varialbles
controlMsg["index"] = 2;
controlMsg["speed"] = 120;
controlMsg["step"] = 200;
controlMsg["command"] = 1;
controlMsg["style"] = 2;
return controlMsg;

Output:

Error msg.