Other Projects

[CB for BP] Node.js GPIO control test

2 7469
Post Last Edited by tony_zhang at 2014-5-6 13:03

Node.js can be a good way to control the Hardware GPIO.
First of all,  set up the git
  1.   sudo apt-get install git
Copy the Code
then get the node-gpio source:
  1.    git clone git://github.com/youyudehexie/node-cubieboard-gpio.git
Copy the Code
And I assume we have already set up the node.js develop environment, if not check this thread:
http://forum.lemaker.org/viewthread.php?tid=270&extra=page%3D1


change to the root:
su

root@cubieboard2:~/
  1. npm install node-gyp -g
Copy the Code
  1. cd node-cubieboard-gpio/
Copy the Code
root@cubieboard2:~/
  1. node-cubieboard-gpio$ node-gyp configure
Copy the Code
root@cubieboard2:/home/linaro/node-cubieboard-gpio#
  1. node-gyp build
Copy the Code
root@cubieboard2:/home/linaro/node-cubieboard-gpio#
  1. node run.js
Copy the Code
In run.js you can modify the GPIO PIN, etc. It tests ok, with the help of multimeter.
I will buy a breadboard, and use some LED for a experiment. To be continued..
Support!

icebob  
Great, thanks!

You have to log in before you can reply Login | Sign Up

Points Rules