noopkat / oled-js Goto Github PK
View Code? Open in Web Editor NEW:tv: johnny-five compatible lib for OLED screens
License: MIT License
:tv: johnny-five compatible lib for OLED screens
License: MIT License
The 'color' argument for the 'writeString' method is not working. Regardless of value, it always outputs as 1, never 0.
It looks like the arg 'color' is not referenced anywhere in the 'writeString' method
Hi,
I would like to know if it's possible to have a scroll for text that are more longer that the screen size ?
Regards,
Dear @noopkat
I 'd like to use your library to generate 1 or 2 or 3 or 4 lines in a 64x32 or 128x64 pixels picture using ssd1306.
Each line could have different fonts and sizes depending of the number of lines.
This a layout I am looking to do by using javascript or typescript to generate on the fly the png or bitmap to display to a oled display
TEXT264x32_PIXELS_PNG_OR_BITMAP_1_COLOR_DEPTH_AND RGB_8BITS.pdf
Otherwise nice on twitch. Success
Best Regards
Youssef
Dear @monteslu , @igorklopov , @noopkat , @psyrax , @rudacs
Nice library but how we could center a bitmap or position it if the size is less than the screen size?
I 'd like to position 6 icons (bmp or png) and position each one in a defined x,y position.
How to do that even to use to drawpixel command ?
And finally, is there a way to manage Layers that means I have a background picture, and some time I have popup like (Yes - No) ? And when selecting one of this option of the popup, Clear the popup without to reload the background picture ?
Best Regards
Season's greetings
Youssef
Hi,
have you thought about transfer chunks of data instead of bytes for a full screen update ?
https://github.com/noopkat/oled-js/blob/master/oled.js#L398
What do you think ?
hello, great work!!!
would it be possible to use different displays than the ssd1306?
i'm asking because i'm currently trying to connect an ssd1322 to my raspberry via nodejs.
i found a great library, but its just for c... (https://github.com/olikraus/u8glib)
it would be amazing to port this to nodejs to your oled-js module.
best regards
paul
It would be great if we could use types like Color
and Pixel
exported from oled-js
instead of guessing and making our own types.
I'm getting the similar effect as the mentioned "SPI screens" slowness on a I2C OLED screen.
I have a small 128x64 OLED screen, but the refresh rate is very very poor. You can even see when the screen refreshes to the newest value.
Also I found a bug with oled.writeString
method. Something is not properly implemented, because if I call the method 10-20 times in a second, I get an error:
(node:17852) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 201 I2C-reply-60-0 listeners added to [Firmata]. Use emitter.setMaxListeners() to increase limit
Questions here:
Here: https://github.com/noopkat/oled-js/blob/master/oled.js#L103 should be:
this._setUpI2C(opts);
And here: https://github.com/noopkat/oled-js/blob/master/oled.js#L158-L160 should be:
Oled.prototype._setUpI2C = function(opts) {
// enable i2C in firmata
this.board.io.i2cConfig(opts);
Otherwise non-firmata io-plugins are unable to send special properties along to i2cConfig
, which results in bugs like this: rwaldron/tessel-io#18
Error:
>> /tmp/remote-script/node_modules/tessel-io/lib/index.js:842
state.i2c[address].send(buffer);
^
TypeError: Cannot read property 'send' of undefined
at Board.i2cWrite (/tmp/remote-script/node_modules/tessel-io/lib/index.js:842:25)
at t._transfer (/tmp/remote-script/node_modules/oled-js/oled.js:1:2777)
at t._initialise (/tmp/remote-script/node_modules/oled-js/oled.js:1:2133)
at new t (/tmp/remote-script/node_modules/oled-js/oled.js:1:1652)
at t.<anonymous> (/tmp/remote-script/index.js:1:226)
at emitNone (events.js:72:20)
at t.emit (events.js:166:7)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickDomainCallback (node.js:390:13)
Code:
var five = require('johnny-five'),
Oled = require('oled-js');
var Tessel = require("tessel-io");
var board = new five.Board({
io: new Tessel()
});
board.on('ready', function() {
var opts = {
width: 128,
height: 32,
address: 0x06
};
var oled = new Oled(board, five, opts);
var font = require('oled-font-5x7');
oled.drawCircle(30, 10, 5, 1);
oled.update();
});
Hello, please tell me how to solve this problem
I'm unable to render text on the screen. For some reason, my code appears to not clear the screen properly and finish the rendering.
const five = require('johnny-five');
const board = new five.Board();
const Oled = require('oled-js');
const font = require('oled-font-5x7');
board.on('ready', function () {
const opts = {
width: 128,
height: 64,
address: 0x3C
};
const oled = new Oled(board, five, opts);
oled.clearDisplay();
oled.setCursor(1, 1);
oled.writeString(font, 1, 'Cats and dogs are really cool animals, you know.', 1, true, 2, true);
oled.update();
})
I used this code and confirmed the LCD works fine but when I run the StandardFirmataPlus on the board and execute the above JS code this is what I end up with – the Hello World doesn't seem to get cleared and the text seems cut off as if the screen dimensions are smaller than 128x64.
Can someone say what I'm doing wrong?
Are you looking to port this library to newer js standards?
I really like your API for the oled displays. Unfortunately I am not able to use it yet as I am using my Johnny Five either with a
Is there any way to figure out the correct address for the display? Would really help me out.
we could be creating much smaller taballs on publish if we npmignored:
According to the documentation SPI screen drawing is very slow. But I found a video where someone uses the same connection with an arduino board and he gets solid fps rates.
Can you explain me why SPI update of this library is very very slow? Where is the bottleneck (in theory there should be no bottleneck)?
Here is the video:
https://www.youtube.com/watch?v=sFGsYZ0Hszk
Also this one:
https://www.youtube.com/watch?v=xI6dXTA02UQ
this is definitely a nice to have, and not required for release.
Hi @noopkat,
I came across your oled-js project.
I'm trying to draw on a e-ink display module which requires SPI.
I was wondering if you can point me to the best resources you managed to find on how to use SPI as efficiently as possible. For your project, you mentioned it is slow when using SPI. (I'm trying to make a second e-ink display HDMI monitor).
It's also nice to see a fellow Melburnian make it to the big leagues in the US. Keep up the good work! I wouldn't be surprised if I've actually met you at a meetup or two either.
Regards,
PJ
In accompaniment to dimDisplay() method.
Put in any missing commands
Hi.
I would like to use a slightly larger font (monospaced would be good enough for me). However, doubling the 5x7 font is too large. So, I am wondering how can I create new fonts files? Do you have a tool to create the json file and what is the source file format for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.