Giter Club home page Giter Club logo

scrollingtext8x8display's Introduction

ScrollingText8x8Display

This library allows you to display a scrolling text on a 8x8 LED display.

You can set the scrolling speed, the scrolling direction and also the character orientation.

Download it from GitHub.

Example

Hardware

Read the tutorials below to learn how to setup a 8x8 LED display with arduino:

Software

To install, copy the ScrollingText8x8Display folder into your arduino sketchbook-libraries folder. More detailed instructions are here. The Library Manager can be used from arduino version 1.6.2.

Setting up

#include "ScrollingText8x8Display.h"

ScrollingText8x8Display render;

void setup()
{
  byte displayRowPins[] = {2, 3, 4, 5, A3, A2, A1, A0}; // Ps: ``A3 = 17; A2 = 16; A1 = 15; A0 = 14;``
  byte displayColumnPins[] = {6, 7, 8, 9, 10, 11, 12, 13};

  ScrollingDirection scrollingDirection = RIGHT_TO_LEFT;
  CharacterOrientation characterOrientation = TOP;
  render.init(displayRowPins, displayColumnPins, scrollingDirection, characterOrientation);
}

void loop()
{
  render.displayText("Hello");
  render.displayText(" World!");
  render.displayText(" ");

  float scrollingSpeed = 55.5;
  render.displayText("slow.... text!", scrollingSpeed);
}

Documentation

Initialize the ScrollingText8x8Display.

  • @param displayRowPins - is an array that stores the arduino pin numbers of the corresponding row pins of the 8x8 LED display. see the picture below. See "matrix of the pin connections" table in the Arduino Lesson - 8x8 LED display tutorial.
  • @param displayColumnPins - is an array that stores the arduino pin numbers of the corresponding column pins of the 8x8 LED display. See "matrix of the pin connections" table in the Arduino Lesson - 8x8 LED display tutorial.
  • @param scrollingDirection - optional - Define the scrolling direction. Can be TOP_TO_BOTTOM, RIGHT_TO_LEFT, BOTTOM_TO_TOP or LEFT_TO_RIGHT. Default value is RIGHT_TO_LEFT.
  • @param characterOrientation - optional - Define the character orientation. Can be TOP, RIGHT, BOTTOM or LEFT. TOP is the normal orientation of a character. So RIGHT means the character is rotated to right. Default value is TOP.
void init(
  byte displayRowPins[],
  byte displayColumnPins[],
  ScrollingDirection scrollingDirection,
  CharacterOrientation characterOrientation);

Display a text on a 8x8 LED display.

  • @param text - The text to be displayed.
  • @param scrollingSpeed - optional - The scrolling speed is between 1.0 (lowest speed) and 100.0 (highest speed). 90.0 is the default value.
  void displayText(String text, unsigned long scrollingSpeed);

Display a character on a 8x8 LED display.

  • @param index - The index of the character to be displayed. The value is between 0 (0x00) and 255 (0xFF). You can find the characters corresponding to each index in the section below:
  • @param scrollingSpeed - optional - The scrolling speed is between 1.0 (lowest speed) and 100.0 (highest speed). 90.0 is the default value.
  void displayCharacter(int index, unsigned long scrollingSpeed);

8x8 Characters Overview

image source

To know the index of a character we combine the column index with the row index. Both column and row index are hexadecimal values.

For example the heart ❤ (column index: 0x and row index: x3) is at index 0x03.

  int heartIndex = 0x03;
  render.displayCharacter(heartIndex); // display a scrolling heart ❤.

ScrollingDirection enumeration

enum ScrollingDirection
{
  TOP_TO_BOTTOM,
  RIGHT_TO_LEFT,
  BOTTOM_TO_TOP,
  LEFT_TO_RIGHT
};

CharacterOrientation enumeration

enum CharacterOrientation
{
  TOP,
  RIGHT,
  BOTTOM,
  LEFT
};

scrollingtext8x8display's People

Contributors

thejlifex avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.