Giter Site home page Giter Site logo

infoticker's Introduction

JLInfoTicker

Smooth scrolling text library for the SSD1306 display / Arduino. With this library you can display a horizontal scrolling textline on your SSD1306 display. The scrolling text will appear either on top or bottom of your display. There is no restriction about the length of the textline, this is especially useful for displaying live messages such as feeds or measurement data.

I've written this library for the Wemos LOLIN32 board, which uses an ESP32 with a SSD1306 OLED display. GitHub Logo

For a live view, see https://youtu.be/L9V65wh85Yk

Features

  • smooth scrolling (per pixel)
  • no text length restriction
  • dynamic text support
  • Font, speed and alignment parameters
  • easy operation

Restrictions

You have to use a monospaced Font. I have provided one font with one size, but you can generate more fonts with an online generator: http://oleddisplay.squix.ch/

Installation

Just include the JLInfoTicker.h in your arduino library path

Usage

  1. include the JLInfoTicker.h file
  2. create an instance and initialize with following parameters:
  • the SSD1306 instance
  • the Font the library will use
  • the callback function for providing your text
  1. call the tick() function periodically, typically in between the loop() function.

Interface

  • void init(SSD1306Wire *oled,const uint8_t *fontData, InfoTickerCallback cb )
  • void setScrollDelay(int sdelay) (in ms, default 25ms)
  • int getScrollDelay()
  • void setBottomAligned(bool ba) (true=>bottom, false=top, default bottom)
  • bool isBottomAligned()
  • void tick()

Remarks

The callback function for providing your text has following signature: typedef String (* InfoTickerCallback)(int); This function will be called every time a new text is required, this can be initially or if a previous text was fully scrolled. The incoming parameter is an incrementing counter value which you can use for your logic to return your desired text, for example: periodically alternating 4 textlines:

String abc[]={"Text line AAA", "Text line BBB","Text line CCC,"Text line DDD"};

infoTicker.init(& display,Monospaced_plain_12,[](int nr){int n=nr%4;return abc[n];});

Example

See the file InfoTickerTest.inoin the examples folder.

infoticker's People

Contributors

androdlang avatar

Watchers

James Cloos 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.