ssd1306-i2c-js
Description
Module ssd1306-i2c-js is a simple javascript wrapper of vadzimyatskevich/SSD1306. No logic added, just existing methods wrapped.
How to use
Import in node js
Install library, simple run:
npm install --save ssd1306-i2c-js
Use in your project
Typescript
Javascript
var ssd1306 = ;var display = ssd1306display;var Font = ssd1306Font;var Color = ssd1306Color;var Layer = ssd1306Layer;
Configure and setup your display using init(i2cNumber, address) method.
Parameter i2cNumber is the mini-pc i2c bus name in /dev/
in with is connected display.
Parameter address is the i2c address of display driver ad specified in datasheet.
display; // Open bus and initialize driverdisplay; // Turn on display moduledisplay; // Clear display bufferdisplay; // Write buffer in display registries
Setup font
display;
Available fonts are defined in Font
enum.
Drawing functions
Following function are available.
display;display;display;display;display;
Refresh function
Use the refresh
method to update the display.
display;
Dispose i2c bus
To close i2c bus call dispose
function.
process;