Giter Site home page Giter Site logo

xpapla / it8951 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnzzz/it8951

1.0 0.0 0.0 870 KB

Raspberry Pi node.js package for e-papers controlled by IT8951 such as WaveShare e-paper HAT.

License: GNU General Public License v3.0

JavaScript 0.05% C++ 2.89% Python 0.23% C 86.16% TypeScript 10.66%

it8951's Introduction

it8951

it8951 is a node.js module written in typescript for the IT8951 e-paper controller. Only tested on the WaveShare e-paper HAT, but should in theory work in other situations.

Update speed

The speed to update the screen is directly linked to the amount of data being transferred. If the update frequency is not quick enough then try to use a lower bits per pixel image.

Hardware compatibility

The package is compatible with any version of Raspberry Pi or similar boards with a BCM2835 chip and tested on a Raspberry Pi 4. It should be compatible with a generic IT8951 setup, but has only been tested on a WaveShare e-paper HAT.

Examples

Displaying an image on the screen requires you to first have written the image to the buffer. In general it's also a good idea to put the display to sleep after you're done as long term usage in the active power state can damage the screen.

async function displayImage(image: Buffer){
    const screen = new it8935(1500); // Change voltage to what is suggested on your e-paper
    screen.run(); // Wake up screen
    await screen.waitForDisplayReady(); // Wait for screen to be ready

    screen.writePixels( // Write to image buffer
        0, // Top corner
        0, // Left corver
        info.width, // Image width, in this case use full screen size
        info.height, // Image width, in this case use full screen size
        image, // Image buffer
        PIXEL_PACKING.BPP8 // Bits per pixel in image
    );

    screen.displayArea( // Display from image buffer
        0, // Top corner
        0, // Left corner
        info.width, // Image width, in this case use full screen size
        info.height, // Image width, in this case use full screen size
        mode // Refresh mode
    );

    screen.sleep(); // Put display to sleep
}

There are further examples in the examples directory.

Documentation

Full documentation found here.

License note

This package includes a copy of the C library for Broadcom BCM 2835 by Mike McCauley under open source use. Commercial use requires a license for bcm2835.

it8951's People

Contributors

dependabot[bot] avatar gnzzz avatar xpapla avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.