npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-epd

v1.0.0

Published

Node.js binding of waveshare e-ink display driver for Raspberry-Pi

Downloads

5

Readme

node-epd

Nodejs library for Waveshare e-Paper modules

Information

Library is writed for 2.9" waveshare e-paper display, but it should work for 1.54", 2.13".

Requirements

  • wiringPi
  • libfreetype6-dev

Example

var lcd = new Lcd(0, 4, 10, 5, 1, 55); //initialize display
lcd.clear(); //clear all lcd
var fontAwesome = lcd.font('./test/fontawesome-webfont.ttf', 10); //load ttf font
var robotoFont = lcd.font('./test/Roboto-Regular.ttf', 14); //load ttf font
lcd.char(fontAwesome, 50, 110, 0xf206); //draw char (utf16)
lcd.drawString(robotoFont, 10, 50, "Hello"); //draw string (utf8)
lcd.circle(10,20,25, true); //draw filled circle
lcd.rect(50, 8, 50, 50); //draw rect
lcd.update(function() { //update all display
  console.log("LCD updated");
  lcd.clearPart(); //switch to partitial update mode
  lcd.rect(100, 100, 20, 20); //draw rect
  lcd.line(100, 100, 120, 120); //draw line in rect
  lcd.partUpdate(); //update only changed part of display
});

Documentation

Classes

Typedefs

Lcd

Main Lcd driver class

Kind: global class

new Lcd(channel, dc, cs, rst, led)

| Param | Type | Description | | --- | --- | --- | | channel | number | spi channel | | dc | number | dc pin | | cs | number | cs pin | | rst | number | rst pin | | led | number | additional led pin |

lcd.font(ttfPath, font) ⇒ FontFace

Load ttf font

Kind: instance method of Lcd
Returns: FontFace - Description of return value.

| Param | Type | Description | | --- | --- | --- | | ttfPath | string | font path | | font | number | size |

lcd.size() ⇒ EpdSize

Return lcd resolution

Kind: instance method of Lcd
Returns: EpdSize - display width and height

lcd.clear()

Clear whole screen and set all refresh mode

Kind: instance method of Lcd

lcd.clearPart()

Change display mode to partial drawing

Kind: instance method of Lcd

lcd.update()

Update whole screen

Kind: instance method of Lcd

lcd.partUpdate()

Update changed part of screen

Kind: instance method of Lcd

lcd.line(x, y, x2, y2, col)

Draw line

Kind: instance method of Lcd

| Param | Type | Description | | --- | --- | --- | | x | number | start point on x axis | | y | number | start point on y axis | | x2 | number | end point on x axis | | y2 | number | end point on y axis | | col | Color | line color |

lcd.rect(x, y, width, height, fill, col)

Draw rect

Kind: instance method of Lcd

| Param | Type | Description | | --- | --- | --- | | x | number | start point on x axis | | y | number | start point on y axis | | width | number | rect width | | height | number | rect height | | fill | bool | If true rect is filled | | col | Color | rect color |

lcd.circle(x, y, r, fill, col)

Draw circle

Kind: instance method of Lcd

| Param | Type | Description | | --- | --- | --- | | x | number | mid point on x axis | | y | number | mid point on y axis | | r | number | circle size | | fill | bool | If true circle is filled | | col | Color | circle color |

lcd.pixel(x, y, col)

Draw pixel

Kind: instance method of Lcd

| Param | Type | Description | | --- | --- | --- | | x | number | point on x axis | | y | number | point on y axis | | col | Color | pixel color |

lcd.drawChar(x, y, char) ⇒ Rect

Draw character from 16 bit representation

Kind: instance method of Lcd

| Param | Type | Description | | --- | --- | --- | | x | number | point on x axis | | y | number | point on y axis | | char | number | char code |

lcd.drawString(font, x, y) ⇒ Rect

Draw string from 8bit representation

Kind: instance method of Lcd
Returns: Rect - drawed coordinates

| Param | Type | Description | | --- | --- | --- | | font | FontFace | Font to draw string | | x | number | x position | | y | number | y position |

lcd.color(color)

Set default color to use

Kind: instance method of Lcd

| Param | Type | Description | | --- | --- | --- | | color | number | 0 is white, 1 is black, -1 is inversion of current state |

Rect : Object

Rect object

Kind: global typedef
Properties

| Name | Type | | --- | --- | | xMin | number | | yMin | number | | xMax | number | | yMax | number |

FontFace : Object

FT_Face object wrapper

Kind: global typedef
Properties

| Name | Type | Description | | --- | --- | --- | | size | number | font size | | height | number | font size in px |

EpdSize : Object

EpdSize object

Kind: global typedef
Properties

| Name | Type | Description | | --- | --- | --- | | width | number | Display width in px | | height | number | Display height in px |

Color : number

Drawing color -1 inverse, 1 black (default), 0 white

Kind: global typedef