# epd7x5-v2

> node module for the 7.5 inch waveshare epaper display

Latest version **0.0.1** (published 2020-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install epd7x5-v2
pnpm add epd7x5-v2
yarn add epd7x5-v2
bun add epd7x5-v2
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-02-16 |
| First published | 2020-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 2 |
| Author | Wiktor Toporek |
| Maintainers | vviktor |
| Keywords | epaper, epd, waveshare |

## Links

- npm: https://www.npmjs.com/package/epd7x5-v2
- Repository: https://github.com/vViktorPL/epd7x5
- Homepage: https://github.com/vViktorPL/epd7x5#readme
- Issues: https://github.com/vViktorPL/epd7x5/issues
- npm.io page: https://npm.io/package/epd7x5-v2

## Dependencies (1)

- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.1

## Recent versions

- 0.0.1 (latest) — 2020-02-16

## README

# epd7x5-v2
A Node.js package for the [7.5inch e-Paper HAT(B) V2 (12.2019) Waveshare display](https://www.waveshare.com/wiki/7.5inch_e-Paper_HAT_(B\)) on a Raspberry Pi 2/3/zero.

It can consume BGRA image color buffer which may be produced by using for instance [node-canvas](https://github.com/Automattic/node-canvas) library.

## Dependencies
WiringPi for GPIO access of Raspberry Pi

## Installation
1. Enable the SPI interface on Raspberry Pi: `sudo raspi-config` 
2. WiringPi: follow installation on [wiringpi.com](http://wiringpi.com/download-and-install/)
3. (optional) Install [node-canvas](https://github.com/Automattic/node-canvas): `npm i canvas`
4. epd7x5-v2: `npm i epd7x5-v2`

## Example

This example requires [node-canvas](https://github.com/Automattic/node-canvas) library installed.

```typescript
import * as epd from 'epd7x5-v2';
import { createCanvas, registerFont } from 'canvas';

// Initialize canvas
registerFont('/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf', { family: 'DejaVu' });
const canvas = createCanvas(epd.RES_WIDTH, epd.RES_HEIGHT);
const ctx = canvas.getContext('2d');

// Draw something
ctx.antialias = 'none';
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, epd.RES_WIDTH, epd.RES_HEIGHT);
ctx.font = '65px DejaVu';
ctx.textBaseline = 'top';
ctx.fillStyle = 'black';
ctx.fillText('Hello World!', 5, 5);
ctx.fillStyle = 'red';
ctx.fillText('Hello World!', 5, 105);
ctx.fillRect(5, 205, 500, 69);
ctx.fillStyle = 'white';
ctx.fillText('Hello World!', 5, 205);

// Send image to the HAT and sleep
epd.init();
epd.displayImageBuffer(canvas.toBuffer('raw'));
epd.deepSleep();
```

## Roadmap

* Rewrite to async code

---
_Source: https://npm.io/package/epd7x5-v2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
