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

onion-omega-oled-text

v1.0.13

Published

Write text with big 16x16 font on the OLED expansion of the Onion Omega / Omega2

Downloads

17

Readme

onion-omega-oled-text

Write text with big 16x16 font on the OLED expansion of the Onion Omega / Omega2

Any contributions / PRs welcome!

Prerequisites

  • Onion Omega / Onion Omega 2
  • Onion OLED expansion

Installation

  1. Make sure you have Node.js and npm installed on your Omega. To do so, ssh into your device (or open the terminal from the web console) and then run the following commands:
opkg update
opkg install nodejs
opkg install npm

Then check if the oled-exp command works by running the following:

oled-exp -h

It should print out a help containing a list of commands.

Then go into your local project directory and execute:

npm install onion-omega-oled-text

Example usage

Within your project, create a .js file like this:

var omegaOledText = require('onion-omega-oled-text');

omegaOledText.init().then(function() {
  omegaOledText.writeText('Hello\nworld!');
});

More examples

Check out example.clock.js

(When using the example code in a local folder where you plan to use it with the node module, please change require('./index') to require('onion-omega-oled-text')).

Character support

Out of the box, the following characters are supported:

  • 0-9
  • a-z
  • A-Z
  • !?"':,;+-=()$./@
  • space character

You can, however, add your own custom characters! There is a character editor available (editor.html) which will help you creating the necessary matrix for the character. Once you have created your character, copy the character byte matrix array from the input field at the bottom of the page and use it e.g. as follows:

var omegaOledText = require('onion-omega-oled-text');

omegaOledText.addCharacter('♥', ['0x00','0x78','0xfc','0xfe','0xfe','0xfc','0xf8','0xf0','0xf8','0xfc','0xfe','0xfe','0xfc','0x78','0x00','0x00','0x00','0x00','0x01','0x07','0x0f','0x1f','0x3f','0x7f','0x3f','0x1f','0x0f','0x03','0x01','0x00','0x00','0x00']);

omegaOledText.init().then(function() {
  omegaOledText.writeText('Hello! ♥');
});

Please also note that currently (02/2017) the vi/vim/nano versions of the omega do not support all utf8 characters, therefore it's possible that you see other characters instead. This does however not influence the execution of the script.

Commands

  • init() Initialize the display
  • writeText(text, reset = true) If reset is set to true (default), text will start at the beginning of the display and other contents will be erased.
  • addCharacter(character, byteMatrix) Add a new character that can be used in writeText or replace an existing one, see custom character example above
  • setStandbyTimeout(secondsOfInactivity = 0) Configures the time of inactivity (in seconds) after which the display should turn off to save power. Display is turned back on automatically when writeText is called next time. Disabled (0) by default.

If you need more commands, have a look at: https://github.com/jonathan-reisdorf/node-onion-omega-oled

Additional information

How many 16x16 characters fit onto the OLED screen?

8 characters x 4 lines

Line breaks

As shown in the example, you can create line breaks by inserting \n into your text.