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

raspberrypi-oled-text

v1.13.0

Published

Use three lines of scrollable text on OLED lcd from a Raspberry Pi

Downloads

5

Readme

raspberrypi-oled-text

Use three lines of scrollable text on OLED lcd from a Raspberry Pi

Installation

npm i raspberrypi-oled-text

Basic Usage

const Oled = require('raspberrypi-oled-text');

const oled = new Oled();
oled.on('ready', () => {
  oled.firstLineScroll = 'on';
  oled.firstLine = 'Line 1 scroll';
  oled.secondLineScroll = 'off';
  oled.secondLine = 'Line 2 no scroll';
  oled.thirdLineScroll = 'auto';
  oled.thirdLine = 'Line 3 autoscroll';
});
oled.init();

Scroll modes

Valid scroll mode values:

  • 'on' - The line will scroll
  • 'off' - The line will not scroll
  • 'auto' - The line will scroll only if the characters don't fit onto the screen width

Optimization

When setting consecutively the scroll mode and the text content of a line you should use the method instead of the setter

oled.firstLineScroll = 'on';          //  Uses two process commands internally
oled.firstLine = 'Not optimized';     //  (not optimized)

oled.setFirstLine('Optimized', 'on'); // Uses only one process command internally (optimized)

API

  • Methods
    • init() - Starts the Oled lcd
    • setFirstLine(text, scroll) - Sets the first line scroll mode and text.
      • text - String - REQUIRED - The text content of the first line.
      • scroll - String - REQUIRED - The scroll mode of the first line.
    • setSecondLine(text, scroll) - Sets the second line scroll mode and text.
      • text - String - REQUIRED - The text content of the second line.
      • scroll - String - REQUIRED - The scroll mode of the second line.
    • setThirdLine(text, scroll) - Sets the third line scroll mode and text.
      • text - String - REQUIRED - The text content of the third line.
      • scroll - String - REQUIRED - The scroll mode of the third line.
  • Members
    • ready - Boolean - READ-ONLY - True if the Oled screen is ready to be controlled
    • firstLine - String - The text content of the first line. Default empty string
    • secondLine - String - The text content of the second line. Default empty string
    • thirdLine - String - The text content of the third line. Default empty string
    • firstLineScroll - String - The scroll mode of the first line. Default 'auto'
    • secondLineScroll - String - The scroll mode of the second line. Default 'auto'
    • thirdLineScroll - String - The scroll mode of the third line. Default 'auto'
  • Events
    • 'ready' - Fires when the Oled screen is ready to be controlled