adapter for cylon on pcduino
Install Node.js
Make sure you have internet connection and open up the terminal on the RPi.
Installing an ARM-version of Node has become very easy:
<code>wget http://node-arm.herokuapp.com/node_latest_armhf.deb sudo dpkg -i node_latest_armhf.deb </code>
That’s it, basically. It shouldn’t take too long to download and install.
To make sure it ran correctly, run node -v. It should return the current version.
Running npm -v or npm –version still gave me the known Illegal instruction error. However, installing modules with npm install works.
install cylon-pcduino by the following command:
<code>npm install cylon-pcduino </code>
if you face the issue ssl error: Cert_not_yet_valid, that is because your system date of Ubuntu. change the date to the current date by usting
<code>sudo date 120622012014.59 </code>
replace the 120622012014.59 to current time
example
<span class="pl-s1"><span class="pl-pds">'</span>use strict<span class="pl-pds">'</span></span>;
<span class="pl-en">console</span><span class="pl-s3">.log</span>(<span class="pl-s1"><span class="pl-pds">"</span>hello test<span class="pl-pds">"</span></span>);
<span class="pl-s">var</span> Cylon <span class="pl-k">=</span> <span class="pl-s3">require</span>(<span class="pl-s1"><span class="pl-pds">"</span>cylon<span class="pl-pds">"</span></span>);
Cylon.robot({
connections<span class="pl-k">:</span> {
pcduino<span class="pl-k">:</span> { adaptor<span class="pl-k">:</span> <span class="pl-s1"><span class="pl-pds">'</span>pcduino<span class="pl-pds">'</span></span> }
},
devices<span class="pl-k">:</span> {
led<span class="pl-k">:</span> { driver<span class="pl-k">:</span> <span class="pl-s1"><span class="pl-pds">'</span>led<span class="pl-pds">'</span></span>, pin<span class="pl-k">:</span> <span class="pl-c1">10</span> }
},
<span class="pl-en">work</span>: <span class="pl-st">function</span>(<span class="pl-vpf">my</span>) {
every((<span class="pl-c1">1</span>).second(), my.led.toggle);
}
}).<span class="pl-sc">start</span>();
Todo
1, add pwm-pin. 2, add analog pin. 3, add i2c
License
Copyright (c) 2014 Zhaoqiang Wang. Licensed under the Apache 2.0 license.
Original post fromĀ https://github.com/alexwang2013/cylon-pcduino
Leave a Reply
You must be logged in to post a comment.