intel edison with grove lcd
with Intel LCD
2023-09-11 14:21:01 时间
由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
版权声明:本文博客原创文章。博客,未经同意,不得转载。
相关文章
- Lower Power with CPF(二)
- [AWS] CloudFormation: create EC2 with SecurityGroupIds for custom VPC
- [Jest] Restore the Original Implementation of a Mocked JavaScript Function with jest.spyOn
- [React] Reduce Code Redundancy with Custom React Hooks
- [Poi] Customize Babel to Build a React App with Poi
- [Python] Indexing An Array With Another Array with numpy
- [HTML5] Track First Contentful Paint with PerformanceObserver and Google Analytics
- [Algorithms] Classify Mystery Items with the K-Nearest Neighbors Algorithm in JavaScript
- [Python] Indexing An Array With Another Array with numpy
- [RxJS] Multicast with a selector argument, as a sandbox
- [RxJS] Reactive Programming - Clear data while loading with RxJS startWith()
- 成功解决AttributeError: Can only use .cat accessor with a ‘category‘ dtype
- 【CV with Pytorch】第 5 章 : 基于图像的搜索和推荐系统