We are using node-red to create this application.
Node-red is a flow-based programming tool that help us creating application in a very fast way. If a pre-build node is note avaiable we can create custom functions using Javascript and NodeJS.
Through this application we can control the motors with gesture and proximity.
Prepare the breadboardPrepare a breadboard to connect the PWM output of the Kitra520 connector to a transistor that will drive the motor. Check the connector schematic HERE
Update Linux KernelTo make audio work on Kitra520 we need to install the latest Linux kernel: You can do it by following this step by step tutorial: LINK
Install toolsTo connect the board to the network follow the getting started guide: LINK. We need to install node-red, mplayer and espeak.
$ dnf update
$ dnf install node
$ dnf install npm
$ npm cache clean -f #to download last nodejs version
$ npm install -g n #to download last nodejs version
$ n stable #to download last nodejs version
$ reboot #required for upgrade
$ npm install -g node-red
$ dnf install espeak
If you have troubles running 'dnf update' run the following:
$ sed -i 's|archive\.fedoraproject\.org\/pub|archives\.fedoraproject\.org\/pub\/archive|g' /etc/yum.repos.d/*
And retry.
Run Node-Red and install the applicationRun
node-red &
On your PC open a browser and open a page on this address:
<MY_IP_ADDRESS>:1880
Now you should design a node-red flow that controls the PWM through gestures.
You can start with this example: test_gestures.json and changing the handling of the events according to your motor needs.
To set a PWM you can use the node do_pwm_init.
Comments
Please log in or sign up to comment.