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  = light.read();
    lightValue = Math.round( lightValue*.1);
    lcdMessage = "Light is @ "+lightValue+"%";
    myLCD.setCursor(0,1);
    console.log(lcdMessage); 
    myLCD.write(lcdMessage);
    setTimeout(loop,1000);
}假设碰到例如以下错误
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
版权声明:本文博客原创文章。博客,未经同意,不得转载。
 
                    
                 
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号