首页 > 代码库 > intel edison with grove lcd

intel edison with grove lcd

通过intel xdk,如下的程序可以打印Hello world到grove lcd上


var mraa = require ('mraa');
var LCD  = require ('jsupm_i2clcd');
console.log('Current version of MRAA is', mraa.getVersion());

var light = new mraa.Aio(0);
var lightValue;
var lcdMessage=" ";
var myLCD = new LCD.Jhd1313m1(6, 0x3E, 0x62);

loop();

function loop(){
    lightValue  = http://www.mamicode.com/light.read();>

如果碰到如下错误

ERROR:Error: Cannot find module ‘jsupm_i2clcd‘
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/node_app_slot/main.js:5:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.run

可以通过下面的方法解决更新libmraa 和 upm

</pre><pre name="code" class="javascript">cat > /etc/opkg/mraa-upm.conf <<EOF
src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic
EOF
opkg upgrade
opkg update


然后通过

opkg info upm | head -n2


查看是否得到类似于如下的信息

Package: upm
Version: 0.1.8.32

如果没有得到表明没有安装upm,可以通过如下命令安装

opkg install upm


intel edison with grove lcd