Raspberry Pi Servo Controller Using Node.js
In order to start controlling your servo there are a few things to install first
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
Please go to https://github.com/sarfata/pi-blaster/ for installation instructions.
Also ensure that you have started pi-blaster otherwise the servo won't move.
Ensure that you run npm install
to make sure you have all the dependencies installed.
To get your servo to work you need to plug in the 3 wires.
- The positive (red) wire goes onto pin 2
- The negative / ground (black) needs to go onto pin 6
- The last remaining wire needs to be plugged into pin 11
There are two things that need to be started.
- The main app.js file which setups the web socket connection and hosts the UI. This can be hosted on any machine that the pi can connect to.
npm start
- The client app that runs on the pi which interacts with the servo which must be run on the pi.
node pi-client.js