Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodejs EBOLED draw function is broken #235

Closed
tylergibson opened this issue Aug 18, 2015 · 1 comment
Closed

Nodejs EBOLED draw function is broken #235

tylergibson opened this issue Aug 18, 2015 · 1 comment

Comments

@tylergibson
Copy link

@Jon-ICS Even the most basic draw call results in a segmentation fault in node.

var lcdObj = require('jsupm_i2clcd');
var oled = new lcdObj.EBOLED();
var tBuffer = new Uint8Array(1);
tBuffer[0] = 0xfe;
var error = oled.draw(tBuffer, 1);

https://github.com/intel-iot-devkit/upm/blob/master/src/lcd/eboled.h

There is no test or sample for the draw function to verify it actually works either. The rest of the functionality in EBOLED works - clear, setCursor, home and write. Any help or a working sample would be very appreciated if this function is indeed functional.

@tylergibson
Copy link
Author

Found the issue. You cannot use a Javascript native Uint8Array to pass to draw. It must be a carray defined by swig. The following code works as expected.

var lcdObj = require('jsupm_i2clcd');
var oled = new lcdObj.EBOLED();
var tBuffer = new new lcdObj.uint8Array(1);
tBuffer.setitem(0, 0xfe);
var error = oled.draw(tBuffer, 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant