Software Archive
Read-only legacy content
17061 Discussions

Fix & Sample for LCD on Edison

Bob_Duffy
Moderator
4,885 Views

If you are using the Grove Starter Kit for the IOT Development kit you may be having a problem getting it to work.  Some documentation has the incorrect BUS ID listed and could be the issue. Also you need to make sure the data being sent to the LCD is a string. 

To fix the BUS issue change the BUS ID from 0 to 6, ie from this:, Jhd1313m1(0, 0x3E, 0x62); to Jhd1313m1(6, 0x3E, 0x62);

Also make sure your data you writing the the LCD is a text string. Simple way to do this is add the sensor variable to a text message ie:
lcdMessage = "Light is "+lightValue+".";

Here is sample javascript code that should work using the Intel XDK, which reads from the light sensor then outputs it on the LCD. Connect the light sensor for the Starter Kit to A0, and connect the LCD to any I2C.

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);
}

 

0 Kudos
23 Replies
Scott_B_1
Beginner
655 Views

Hi,

I installed ubilinux on my Edison because I needed some linux features that were not available on the Edison Yocto Linux. The mraa library that comes with the ubilinux install works for most of the I/O cases that I tested, but it does not support the LCD code in your example. I suspect that the ubilinux install has and older version of the mraa library? Can you tell how to upgrade the mraa library on this ubilinux Edison?

Thanks,

0 Kudos
Scott_B_1
Beginner
655 Views

 

I found /usr/lib/node_modules/jsupm_i2clcd in the Edison Yocto Linux install, but this does not exist in the Edison ubilinux install. I tried copying the /usr/lib/node_modules directory to the Edison ubilinux install. The test program no longer complains that it can't find jsupm_i2clcd, but now I get another error "libmraa.so.0: cannot find shared object file .. " although I have checked that this exists in the /usr/lib/node_modules/mraa directory. 

 

0 Kudos
Scott_B_1
Beginner
655 Views
0 Kudos
Reply