Skip to content

404background/node-red-mcu-servo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-red-mcu-servo

OverView

Node-RED MCU pluginに追加できる、サーボモーター用のノードです。

How to install

※Raspberry Pi環境での実行を想定しています。

  1. Node-RED MCUの環境を構築します。

  2. リポジトリをクローンします。

$ cd ファイルのパス
$ git clone https://github.com/404background/node-red-mcu-servo.git
  1. npmでパッケージをインストールし、node_types.jsonを編集します。
$ cd .node-red
$ sudo npm install ファイルのパス
$ cd .node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu
$ sudo nano node_types.json

"lower-case"を参考に、

"servo": "manifest.jsonのパス",  

を追加します。

  1. Node-REDを再起動します。
$ sudo systemctl restart nodered.service

Test Case

角度を受け取って、Servoノードに渡すようにしています。
flow

パルス幅、周期、角度の初期値はSG90に合わせています。
editor

スライダーは0~180に設定しています。
slider

スライダーに合わせて、サーボモーターが回転します。

movie

LINK

Node-RED-MCU: https://github.com/phoddie/node-red-mcu
Moddable SDK: https://github.com/Moddable-OpenSource/moddable
Node-RED「はじめてのノード開発」: https://nodered.jp/docs/creating-nodes/first-node
Qiitaに書いた記事: https://qiita.com/background/items/9b820251aa9dda5a3167
ホームページに書いた記事:
https://404background.com/program/node-create-2

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors