Harmony Clean Flat Responsive WordPress Blog Theme

Blink Led by node.js

오전 5:14 Unknown 0 Comments Category :

This time, I controled led by using GPIO. This is basic knowledge to control GPIO. So this is one of steps for my project.
If it is first time for you to use GPIO and led diode, you need to download and install some packages.


1. Download GPIO package.
type it in terminal
$ git clone git://github.com/quick2wire/quick2wire-gpio-admin.git ~/gpio-admin


2. Go to direntory
$cd   ~/gpio-admin


3. Install package
$make
$sudo make install


4. Assign GPIO
$sudo adduser pi gpio
$3xec su -l pi


5. Download library to use GPIO
$npm install onoff


6. Make your code for Blink led. My code is followed:

7. node foo(your nodejs file name)




Reference:
윤성진(2016), 스마트IoT 및 실습, Korea university of technology & education

RELATED POSTS

0 개의 댓글