aeroniemi / inky-ts

A typescript package to interact with Pimoroni's Inky Impression series of displays. Implemenents a subset of the features of @pimoroni/inky
1 stars 1 forks source link
eink epaper inkyimpression

inky

A typescript package to interact with Pimoroni's Inky Impression series of displays. Implements a subset of the features of @pimoroni/inky

Features

Usage

Install inky

Setup GPIO

(Optional) Setup resvg

Example

Display a PNG

import { Impression73 } from "@aeroniemi/inky"

async function main() {
    let screen = new Impression73()
    screen.display_png("./[IMAGE.png]")
    await screen.show()
}
main()

Display a SVG

import { Impression73 } from "@aeroniemi/inky"

async function main() {
    let screen = new Impression73()
    screen.display_svg("./[IMAGE.svg]")
    await screen.show()
}
main()

Display a PNG with Node.js and Javascript

const epaper = require('@aeroniemi/inky');

async function main() {
    let screen = new epaper.Impression57();
    screen.display_png("./[IMAGE.png]");

    // draw white square
    let w = 100;
    let h = 100;
    let sx = 100;
    let sy = 100;
    for (let x = 0; x < w; x++) {
        for (let y = 0; y < h; y++) {
            screen.set_pixel(x + sx, y + sy, 1);
        }
    }
    await screen.show();
}
main();