A typescript package to interact with Pimoroni's Inky Impression series of displays. Implements a subset of the features of @pimoroni/inky
- Support for:
- Individual pixel interaction
- Setting images in:
- PNG
- SVG (using optional resvg-js dependency)
npm install --save @aeroniemi/inky
- This package uses rpio for GPIO interactions, so you'll need a working install of that
- In particular, you need to:
- Disable GPIO interrupts
- Enable /dev/gpiomem access
- Run as root user (for access to the SPI device)
npm install --save @resvg/resvg-js
- If you're using a Raspberry Pi 3/4/Zero 2W it'll probably "just work", but if you're on a Zero or Zero W you'll need to compile resvg to get it to run properly. See this issue for more details on how.
import { Impression73 } from "@aeroniemi/inky"
async function main() {
let screen = new Impression73()
screen.display_png("./[IMAGE.png]")
await screen.show()
}
main()
import { Impression73 } from "@aeroniemi/inky"
async function main() {
let screen = new Impression73()
screen.display_svg("./[IMAGE.svg]")
await screen.show()
}
main()
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();