Intel Edison with Grove LCD

Source: Internet
Author: User

With intel xdk, the following program can print Hello World to the 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);}


If the following error occurs:

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

Update libmraa and UPM through the following methods:

</pre><pre name="code" class="javascript">cat > /etc/opkg/mraa-upm.conf <<EOFsrc mraa-upm http://iotdk.intel.com/repos/1.1/intelgalacticEOFopkg upgradeopkg update


Then

opkg info upm | head -n2


Check whether the following information is obtained:

Package: upmVersion: 0.1.8.32

If no UPM is installed, run the following command to install it:

opkg install upm


Intel Edison with Grove LCD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.