@tootallnate/oled
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@tootallnate/oled

Render to OLED displays over the I2C bus

This module provides implementations for rendering to OLED displays using a consitent interface. A terminal emulator is also included to make local usage easier.

Individual pixels are accessed using a two-dimensional [x][y] array syntax, where a value of 0 means the pixel is off, and 1 means the pixel is on.

SSD1305

Adafruit 2.23" Monochrome OLED Bonnet for Raspberry Pi

import * as i2c from 'i2c-bus';
import { OledSSD1305 } from '@tootallnate/oled';

const bus = i2c.openSync(1);
const oled = new OledSSD1305({
    bus,
    address: 0x3c,
    width: 128,
    height: 32
});

oled[0][0] = 1;
oled[0][1] = 1;

oled.render();

SSD1306

Adafruit PiOLED - 128x32 Monochrome OLED Add-on for Raspberry Pi

import * as i2c from 'i2c-bus';
import { OledSSD1306 } from '@tootallnate/oled';

const bus = i2c.openSync(1);
const oled = new OledSSD1306({
    bus,
    address: 0x3c,
    width: 128,
    height: 32
});

oled[0][0] = 1;
oled[0][1] = 1;

oled.render();

TTY (Terminal Emulator)

import { OledTTY } from '@tootallnate/oled';

const oled = new OledTTY({
    width: 128,
    height: 32
});

oled[0][0] = 1;
oled[0][1] = 1;

oled.render();
▄   ▄        ▄▄    ▄▄                                  ▄▄       ▄   ▄
█   █  ▄▄▄    █     █    ▄▄▄        ▄   ▄  ▄▄▄  ▄ ▄▄    █    ▄▄ █   █
█▀▀▀█ █▄▄▄█   █     █   █   █       █ ▄ █ █   █ █▀  ▀   █   █  ▀█   █
█   █ ▀▄▄▄   ▄█▄   ▄█▄  ▀▄▄▄▀       ▀▄▀▄▀ ▀▄▄▄▀ █      ▄█▄  ▀▄▄▄█   ▄

Dependents (0)

Package Sidebar

Install

npm i @tootallnate/oled

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

52.2 kB

Total Files

29

Last publish

Collaborators

  • tootallnate