GithubHelp home page GithubHelp logo

ledtext's People

Contributors

aaronliddiment avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ledtext's Issues

Add variables to scrolling or static text

Hi

is it possible to display the value of a variable? Furthermore, is there a method to show it as static text?
The text string is a constant at the moment, so I suppose this is not possible?

For example:

const unsigned char TxtDemo[] =
{" GS: ", %d};
Behind GS i would like to show the value I send to the microcontroller. Something using the analogy of how you show an integer in C.
@AaronLiddiment

J encoding in FontMatrise

Hello,
Does it exist tool to edit codes of char ?
I have an issue with the "J" letter.
One dot is not at good place...
Regards,

Dynamic score display

Hello again,
I am trying to display a score in numbers with one decimal point on my matrix.
In the example, the scrolling text uses const unsigned char array. I am wondering if the SetText function require unsigned char and how do I convert a string to unsigned char in Arduino. Here is my sample code:

cLEDMatrix<WIDTH, HEIGHT, MATRIX_TYPE> leds;

cLEDText Score;

float the_score;
unsigned char SCORE[]= {};
void setup () {
the_score=0;
Score.SetFont(MatriseFontData);
Score.Init(&leds, leds.Width(), Score.FontHeight() + 1, 0, 0);
Score.setText((unsigned char *)SCORE, sizeof(SCORE)-1);

}

void loop () {
//increase the score every cycle
the_score+=0.25;
//assign the_score to SCORE array ---this is where I am unsure
SCORE[0] = String(the_score,1);
if (Score.UpdateText() == -1)
//so the displayed text Score will keep changing every refresh cycle
Score.SetText((unsigned char *)SCORE, sizeof(SCORE) - 1);
else
FastLED.show();
delay(10);
}

Mirrored Text

Hi

congratulations on the wonderful library, I have been searching for a library offering this many functions for a long time.
Unfortunately I have some issues with the way the hardware is set-up. The classic matrix is going from left to right. Well mine is inverted, the LED on the right bottom is the first and the LED on the left top of the matrix is the last. Thus, all my text is mirrored.
For example, the TextExample1 function with a VERTICAL_ZIGZAG_MATRIX type. When the text LEFT SCROLL comes up, it is mirrored and goes right.

Using the NeoMatrix library I could use this:

Adafruit_NeoMatrix(96, 8, DATA_PIN,
NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);
The NEO_MATRIX_RIGHT parameter is what I am looking for. It defines the LED order (from back to front, counter intuitive).
How can I solve this?

Thanks!

EDIT: Found out about the other issue described here and fixed: #1

Documentation for EFFECT_HSV_xx

Is there documentation anywhere on what the following effects do? I read the wiki and the Function List page tells how to use them, but not what the effect actually is.

EFFECT_HSV_CV
EFFECT_HSV_CH
EFFECT_HSV_AV
EFFECT_HSV_AH

And the gradient versions:

COLR_GRAD_CV
COLR_GRAD_AV
COLR_GRAD_CH
COLR_GRAD_AH

Custom Matrix

Hi,
is it possible to use a custom Matrix schema?

i wired my 16x16 matrix diagonal zig zag
(to get the right space between the pixels)

See below (but with 16 insteadt of 8 pixels)

01-02-06-07-15-16-28-29
03-05-08-14-17-27-30-43
04-09-13-18-26-31-42-44
10-12-19-25-32-41-45-54
11-20-24-33-40-46-53-55
21-23-34-39-47-52-56-61
22-35-38-48-51-57-60-62
36-37-49-50-58-59-63-64

diagonal_zig_zag_matrix

Way to have text scroll across two matrix?

Is there a way to have text scroll from one screen to another? I've looked at the LEDMatrix example where it calls out:

FastLED.addLeds<CHIPSET, 9, COLOR_ORDER>(leds[0], 0, NUM_LEDS_PER_STRIP); 
FastLED.addLeds<CHIPSET, 9, COLOR_ORDER>(leds[0], NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP); 

and so on. It looks like this sets it up as one giant matrix (which I'm ok with as long as I can get my text to scroll from one screen to the other).

I see that FASTLed has it set up as:

FastLED.addLeds<CHIPSET, PIN>(leds[0], NUM_LEDS_PER_STRIP);
FastLED.addLeds<CHIPSET, PIN>(leds[1], NUM_LEDS_PER_STRIP);
called as:
leds[x][i] = CRGB::Red;  //  x=led strip

But can't seem to get the [x][i] method to work in LEDText

I've tried playing with the matrix width and number of LED's per strip, but it ends up scrambled (probably due to the LED numbering being off).

Any ideas on this one? Thanks again!

Pic of screen setup:
ScreenSetup

Unable to resize text to small matrix

I have a small matrix that I'm trying to get basic text to scroll across, it's scrolling in the correct direction but the LED's are not correct. For Example, here I am trying to have the number "2" displayed.

What I am actually getting scrolling across my matrix is (with X = on/light):
OOXXXXO
OOOOOOO
OOOOOOO
OOOOOOO
OOOXXOO

const uint8_t RobotronFontData[] = { 5, // Font Width 5, // Font Height

#include <FastLED.h>

#include <LEDMatrix.h>
#include <LEDText.h>
#include <FontRobotron.h>

// Change the next 6 defines to match your matrix type and size

#define LED_PIN        6
#define COLOR_ORDER    GRB
#define CHIPSET        WS2812B

#define MATRIX_WIDTH   7
#define MATRIX_HEIGHT  5
#define MATRIX_TYPE    HORIZONTAL_ZIGZAG_MATRIX

cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;

cLEDText ScrollingMsg;
uint8_t Rate = 3;
const unsigned char TxtDemo[] = {EFFECT_SCROLL_LEFT "   2  "};

void setup()
{
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
  FastLED.setBrightness(64);
  FastLED.clear(true);
  delay(500);
  FastLED.show();

  ScrollingMsg.SetFont(RobotronFontData);
  ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 1, 0, 0);
  ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);
  ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0xff, 0x00, 0xff);
  ScrollingMsg.SetFrameRate(Rate);
}


void loop()
{
  if (ScrollingMsg.UpdateText() == -1)
    ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);
  else
    FastLED.show();
  delay(10);
}

Is the full 'blank' screen necessary after scrolling some text?

Hi,
I have quite a long (8 x 128 for now) matrix to scroll some long text.
All that is working fine, and I am able to modify the text in between passes if needed.

But it always seems to need to scroll the whole text off the matrix before updating to the next (or scrolling again), leaving a fully blank matrix for a moment.

This matrix will eventually need to be longer, for a sign I have been asked to build. Is there any way to "wrap" the start of the next text to the end of the previous one, to avoid having to have a full blank screen/matrix after each 'loop' of the scroll?

I tried the INSTANT_OPTIONS_MODE thinking that might do it, but it didn't work.

Thanks!

Is this library slow? Seems like it from my testing.

I am using the ESP8266 so maybe the ESP32 would be more adequate but I was getting serious framerate drops using the text over top a noise pattern. This library seems to only work well when no other patterns are shown.

If anyone can suggest an alternative I would greatly appreciate it!

text is mirrored

First of all, happy new year ;)

Well im playing around with your library but ran into some issues. All texts are diplayed in mirror writing.

Im Using 8x32 Neopixel Matrix. The Layout of tie Matrix Tile is Columns and the first pixel is in the bottom right corner,
The tiles are aranges int a 2 colums 3 rows matrix same as the tile itself.

4 --- 3
|       |
5     2
|       |
6     1

Im running the Code using your LEDMatrix library on an Heltec ESP32 Wifi Kit and can draw lines from 0, 0 to 63, 23
My Matrix initialisation is:

#define MATRIX_TILE_WIDTH       32           // Width of each panel 
#define MATRIX_TILE_HEIGHT      8            // Height of each panel
#define MATRIX_TILE_H           3            // number of matrices arranged horizontally
#define MATRIX_TILE_V           2            // number of matrices arranged vertically
#define MATRIX_WIDTH            (MATRIX_TILE_WIDTH * MATRIX_TILE_H)
#define MATRIX_HEIGHT           (MATRIX_TILE_HEIGHT * MATRIX_TILE_V)
#define MATRIX_SIZE             (MATRIX_WIDTH * MATRIX_HEIGHT)
#define MATRIX_PANEL            (MATRIX_WIDTH * MATRIX_HEIGHT)
#define NUM_LEDS                (MATRIX_WIDTH * MATRIX_HEIGHT)

cLEDMatrix<MATRIX_TILE_WIDTH,MATRIX_TILE_HEIGHT, VERTICAL_ZIGZAG_MATRIX, MATRIX_TILE_H, MATRIX_TILE_V,VERTICAL_ZIGZAG_BLOCKS> leds;

So i have no clue why text is displayes mirrored even it moves in the right direction
Im Using your Example Code "TextExample 1"
Any hints would be aprecciated, thank you

proper display of lower / upper case when 8 lines availables

With 8 lines availables, I need to display well lower and upper case letters.
Find my suggestion here, from the font Matrise, some letters inspired from adafruit gfx examples.
5, // Font Width 8, // Font Height 32, // Font First Character 127,// Font Last Character 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x20, 0x00, // Code for char ! 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char " 0x50, 0x50, 0xf8, 0x50, 0xf8, 0x50, 0x0A, 0x00, // Code for char # 0x20, 0x78, 0x80, 0x70, 0x08, 0xf0, 0x20, 0x00, // Code for char $ 0xc8, 0xc8, 0x10, 0x20, 0x40, 0x98, 0x98, 0x00, // Code for char % 0x60, 0x90, 0x80, 0x78, 0x90, 0x90, 0x60, 0x00, // Code for char & 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ' 0x10, 0x20, 0x40, 0x40, 0x40, 0x20, 0x10, 0x00, // Code for char ( 0x40, 0x20, 0x10, 0x10, 0x10, 0x20, 0x40, 0x00, // Code for char ) 0x00, 0xa8, 0x70, 0x20, 0x70, 0xa8, 0x00, 0x00, // Code for char * 0x00, 0x20, 0x20, 0xf8, 0x20, 0x20, 0x00, 0x00, // Code for char + 0x00, 0x00, 0x00, 0x60, 0x60, 0x20, 0x40, 0x00, // Code for char , 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, // Code for char - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, // Code for char . 0x10, 0x10, 0x20, 0x20, 0x20, 0x40, 0x40, 0x00, // Code for char / 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char 0 0x20, 0x60, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, // Code for char 1 0x70, 0x88, 0x08, 0x10, 0x20, 0x40, 0xf8, 0x00, // Code for char 2 0xf8, 0x08, 0x10, 0x30, 0x08, 0x88, 0x70, 0x00, // Code for char 3 0x10, 0x30, 0x50, 0x90, 0xf8, 0x10, 0x10, 0x00, // Code for char 4 0xf8, 0x80, 0xf0, 0x08, 0x08, 0x88, 0x70, 0x00, // Code for char 5 0x30, 0x40, 0x80, 0xf0, 0x88, 0x88, 0x70, 0x00, // Code for char 6 0xf8, 0x08, 0x10, 0x20, 0x20, 0x20, 0x20, 0x00, // Code for char 7 0x70, 0x88, 0x88, 0x70, 0x88, 0x88, 0x70, 0x00, // Code for char 8 0x70, 0x88, 0x88, 0x78, 0x08, 0x10, 0x60, 0x00, // Code for char 9 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x00, // Code for char : 0x60, 0x60, 0x00, 0x60, 0x60, 0x20, 0x40, 0x00, // Code for char ; 0x10, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, 0x00, // Code for char < 0x00, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, // Code for char = 0x80, 0x40, 0x20, 0x10, 0x20, 0x40, 0x80, 0x00, // Code for char > 0x70, 0x88, 0x08, 0x10, 0x20, 0x00, 0x20, 0x00, // Code for char ? 0x70, 0x88, 0xa8, 0xd8, 0xb0, 0x80, 0x70, 0x00, // Code for char @ 0x20, 0x50, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x00, // Code for char A 0xf0, 0x88, 0x88, 0xf0, 0x88, 0x88, 0xf0, 0x00, // Code for char B 0x70, 0x88, 0x80, 0x80, 0x80, 0x88, 0x70, 0x00, // Code for char C 0xe0, 0x90, 0x88, 0x88, 0x88, 0x90, 0xe0, 0x00, // Code for char D 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, 0xf8, 0x00, // Code for char E 0xf8, 0x80, 0x80, 0xf0, 0x80, 0x80, 0x80, 0x00, // Code for char F 0x70, 0x88, 0x80, 0xb8, 0x88, 0x88, 0x70, 0x00, // Code for char G 0x88, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x88, 0x00, // Code for char H 0x70, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x00, // Code for char I 0x38, 0x10, 0x10, 0x10, 0x10, 0x90, 0x60, 0x00, // Code for char J 0x88, 0x90, 0xa0, 0xc0, 0xa0, 0x90, 0x88, 0x00, // Code for char K 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf8, 0x00, // Code for char L 0x88, 0xd8, 0xa8, 0xa8, 0x88, 0x88, 0x88, 0x00, // Code for char M 0x88, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x88, 0x00, // Code for char N 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char O 0xf0, 0x88, 0x88, 0xf0, 0x80, 0x80, 0x80, 0x00, // Code for char P 0x70, 0x88, 0x88, 0x88, 0xa8, 0x90, 0x68, 0x00, // Code for char Q 0xf0, 0x88, 0x88, 0xf0, 0xa0, 0x90, 0x88, 0x00, // Code for char R 0x70, 0x88, 0x80, 0x70, 0x08, 0x88, 0x70, 0x00, // Code for char S 0xf8, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, // Code for char T 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char U 0x88, 0x88, 0x88, 0x88, 0x88, 0x50, 0x20, 0x00, // Code for char V 0x88, 0x88, 0x88, 0xa8, 0xa8, 0xa8, 0x50, 0x00, // Code for char W 0x88, 0x88, 0x50, 0x20, 0x50, 0x88, 0x88, 0x00, // Code for char X 0x88, 0x88, 0x50, 0x20, 0x20, 0x20, 0x20, 0x00, // Code for char Y 0xf8, 0x08, 0x10, 0x20, 0x40, 0x80, 0xf8, 0x00, // Code for char Z 0x70, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, 0x00, // Code for char [ 0x40, 0x40, 0x20, 0x20, 0x20, 0x10, 0x10, 0x00, // Code for char BackSlash 0x70, 0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, // Code for char ] 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, // Code for char _ 0x40, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0x00, 0x00, 0x60, 0x10, 0x70, 0x90, 0x78, 0x00, // Code for char a 0x80, 0x80, 0xb0, 0xc8, 0x88, 0x88, 0xf0, 0x00, // Code for char b 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, 0x70, 0x00, // Code for char c 0x08, 0x08, 0x68, 0x98, 0x88, 0x88, 0x78, 0x00, // Code for char d 0x00, 0x00, 0x70, 0x88, 0xf8, 0x80, 0x70, 0x00, // Code for char e 0x30, 0x40, 0xe0, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char f 0x00, 0x00, 0x70, 0x98, 0x98, 0x68, 0x08, 0x70, // Code for char g 0x80, 0x80, 0xb0, 0xc8, 0x88, 0x88, 0x88, 0x00, // Code for char h 0x20, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, // Code for char i 0x10, 0x00, 0x10, 0x10, 0x10, 0x90, 0x60, 0x00, // Code for char j 0x80, 0x80, 0x88, 0x90, 0xa0, 0xd0, 0x88, 0x00, // Code for char k 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x00, // Code for char l 0x00, 0x00, 0xd0, 0xa8, 0xa8, 0xa8, 0xa8, 0x00, // Code for char m 0x00, 0x00, 0xb0, 0xc8, 0x88, 0x88, 0x88, 0x00, // Code for char n 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, // Code for char o 0x00, 0x00, 0xb0, 0xc8, 0xc8, 0xb0, 0x80, 0x80, // Code for char p 0x00, 0x00, 0x68, 0x98, 0x98, 0x68, 0x08, 0x08, // Code for char q 0x00, 0x00, 0xa0, 0xd0, 0x80, 0x80, 0x80, 0x00, // Code for char r 0x00, 0x00, 0x70, 0x80, 0x70, 0x08, 0xf0, 0x00, // Code for char s 0x40, 0x40, 0xf0, 0x40, 0x40, 0x40, 0x30, 0x00, // Code for char t 0x00, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, // Code for char u 0x00, 0x00, 0x88, 0x88, 0x88, 0x50, 0x20, 0x00, // Code for char v 0x00, 0x00, 0xa8, 0xa8, 0xa8, 0xa8, 0x50, 0x00, // Code for char w 0x00, 0x00, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, // Code for char x 0x00, 0x00, 0x88, 0x88, 0x98, 0x68, 0x08, 0x70, // Code for char y 0x00, 0x00, 0xf8, 0x10, 0x20, 0x40, 0xf8, 0x00, // Code for char z 0x10, 0x20, 0x20, 0x40, 0x20, 0x20, 0x10, 0x00, // Code for char { 0x20, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x00, // Code for char | 0x40, 0x20, 0x20, 0x10, 0x20, 0x20, 0x40, 0x00, // Code for char } 0x00, 0x00, 0x48, 0xb0, 0x00, 0x00, 0x00, 0x00, // Code for char ~ 0x70, 0x50, 0x50, 0x50, 0x50, 0x50, 0x70, 0x00 // Code for char �

text display mirroring HORIZONTAL_ZIGZAG_MATRIX

I'm confused as to how to get my HORIZONTAL_ZIGZAG_MATRIX APA102 strips to display properly. I have data entering on the upper left and then zig-zagging back to the lower left over 8 strips of 44 LEDS. My text display ends up flipped both ways.

Looking at your examples, there is a constructor cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;
I can use 'leds.' to access the various mirror functions, but they have no effect on the final output.

Smallest possible font 3 x 5 pixels

Hi!
I would like to make my own small font for a project, consisting of mainly numbers and a decimal point.
I studied the fontMatrise file and kinda figured I need to somehow make the values for each row for characters 46 to 57.

It starts with 0x...then I guess the next 2 digits will determine how many LEDS will light up per row and in what combination.
What I do not understand is the hexadecimal system and how it relates to a 3 x 5 font.
Here are the following combis I need to form a number:

0 0 0 0
0 1 0 0
1 1 1 0
1 0 1 0
1 0 0 0
0 0 1 0
0 1 1 0
1 1 0 0

Can anyone advise how each can be represented in the format 0x00...0xFF?
For my learning, some explanation would be great. I'll gladly contribute the file back to the project for this small number set.

Thanks!

Change of Font Size

I am trying to adapt the existing font examples provided by Aaron Liddiment so as to have a 7 pixel wide and 8 pixel high font. Have read

Aaron Liddiment's instructions about the Font Header File Layout
https://github.com/AaronLiddiment/LEDText/wiki/5.Font-Header-File-Layout

but somehow I don't get it how to solve this. I am an artist, so maybe that's why...

Coming from the FontRobotron example https://github.com/AaronLiddiment/LEDText/blob/master/FontRobotron.h

I thought I could basically

change the

const uint8_t RobotronFontData[] = {
7, // Font Width
7, // Font Height
32, // Font First Character
96, // Font Last Character

				B8(00000000),	// Char  
				B8(00000000),
				B8(00000000),
				B8(00000000),
				B8(00000000),
				B8(00000000),
				B8(00000000),

to

const uint8_t RobotronFontData[] = {
7, // Font Width
8, // Font Height
32, // Font First Character
96, // Font Last Character

				B8(00000000),	// Char  
				B8(00000000),
				B8(00000000),
				B8(00000000),
				B8(00000000),
				B8(00000000),
				B8(00000000),
                                      **B8(00000000),**

and so on for all other chars

But it doesn't seem that simple. Not sure what I am not getting. Has it something to do with the values 32 and 96 (Font First Character and Last Character)? For what do they stand for? Don't get how one gets to 32 and 96? What kind of calculation is underlying these figures?

Sorry, if too basic, but really don't get this. Any help is much appreciated!

Best, Nino

Best method to change text on button push?

I've been trying for a couple hours to change text on a button push (I'm good with all the button part of the code). Do you know what would be the best method to do this?

I've tried adding another cLEDText ScrollingMsg2; as well as redefining stuff various ways within functions

Would it be to redefine const unsigned char TextDemo[] = { ?

Once again, appreciate all the support, you've been a great help!

Example does not work

Hi,
I'm trying to compile the first example. But I'm getting the following error: LED-text:3:23: error: LEDMatrix.h: No such file or directory. What am I doing wrong?

Static text - no scroll

Hi,
This isn't really an issue, but just contributing to what I found out after many trial and errors.

To display static text, the wiki says to use SetText() and UpdateText() at the same time. Didn't work.
So I figured, if you want the text to stay put (no scroll), it has to have the same parameters for every cycle in the loop. Which means, you have to Init() every cycle. That was the AHA moment, so this works:
Example
`
//define your stuff here
void setup () {
// setup stuff here
}
void loop() {
ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight(), X_pos, Y_pos);

if (ScrollingMsg.UpdateText()== -1) {
ScrollingMsg.SetText((unsigned char*)Message, sizeof(Message)-1);
} else {
FastLED.show();

};
}`

So what this does is every time the loop runs, the X and Y pos is set back to the same values instead of being changed by the scrolling functions. You can set the font and other stuff in the setup () part, just reset the Init() in the loop.

Ben

LEDMatrix: field 'm_OutOfBounds' has incomplete type 'CRGB'

Hi there. I'm trying to use LEDText on a WS2812B 32x8 controlled by a Nano 328P. When I try to include LEDText, I get an error regarding LEDMatrix's header file and the struct definitions of CRGB:


                 from D:\OneDrive\Documents\Arduino\sketch_may22a\ledtext\ledtext.ino:1:

LEDMatrix.h:27:17: error: field 'm_OutOfBounds' has incomplete type 'CRGB'

     struct CRGB m_OutOfBounds;

                 ^~~~~~~~~~~~~

D:\OneDrive\Documents\Arduino\libraries\LEDMatrix/LEDMatrix.h:26:12: note: forward declaration of 'struct CRGB'

     struct CRGB *m_LED;

            ^~~~

In file included from C:\Users\jared\AppData\Local\Temp\arduino_build_573779\sketch\config.h:3:0,

                 from D:\OneDrive\Documents\Arduino\sketch_may22a\ledtext\ledtext.ino:1:

D:\OneDrive\Documents\Arduino\libraries\LEDMatrix/LEDMatrix.h: In constructor 'cLEDMatrix<tMWidth, tMHeight, tMType, tBWidth, tBHeight, tBType>::cLEDMatrix(bool)':

LEDMatrix.h:75:111: error: invalid application of 'sizeof' to incomplete type 'CRGB'

           p_LED = (struct CRGB *) malloc(m_absMWidth * m_absBWidth * m_absMHeight * m_absBHeight * sizeof(CRGB));

                                                                                                               ^

In file included from C:\Users\jared\AppData\Local\Temp\arduino_build_573779\sketch\config.h:8:0,

                 from D:\OneDrive\Documents\Arduino\sketch_may22a\ledtext\ledtext.ino:1:

D:\OneDrive\Documents\Arduino\libraries\FastLED/FastLED.h: At global scope:

D:\OneDrive\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003

 #    pragma message "FastLED version 3.003.003"

                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Using library LEDMatrix in folder: D:\OneDrive\Documents\Arduino\libraries\LEDMatrix (legacy)
Using library LEDText in folder: D:\OneDrive\Documents\Arduino\libraries\LEDText (legacy)
Using library FastLED at version 3.3.3 in folder: D:\OneDrive\Documents\Arduino\libraries\FastLED 
exit status 1
field 'm_OutOfBounds' has incomplete type 'CRGB'

I'm not sure if this is a library issue or something I've done, but this occurs even when I've only written the bare minimum setup.

#ifndef config_h
#define config_h
#include <LEDMatrix.h> 
#include <Font12x16.h>
#include <Font16x24.h>
#include <FontMatrise.h>
#include <LEDText.h> 
#include <FastLED.h>
//
// Used by LEDMatrix
#define MATRIX_TILE_WIDTH   8 // width of EACH NEOPIXEL MATRIX (not total display)
#define MATRIX_TILE_HEIGHT  32 // height of each matrix
#define MATRIX_TILE_H       1  // number of matrices arranged horizontally
#define MATRIX_TILE_V       1  // number of matrices arranged vertically
#define COLOR_ORDER GRB
#define NUM_LEDS 256
#define LED_PIN 6

#define BRIGHTNESS 32
#endif

#include "config.h"


cLEDMatrix<-MATRIX_TILE_WIDTH, -MATRIX_TILE_HEIGHT, HORIZONTAL_ZIGZAG_MATRIX,
    MATRIX_TILE_H, MATRIX_TILE_V, HORIZONTAL_BLOCKS> ledmatrix;
CRGB *leds = ledmatrix[0];


// a bunch of definitions for FastLED code


void setup() {
  FastLED.addLeds<WS2812B, LED_PIN, COLOR_ORDER>(ledmatrix[0], ledmatrix.Size());
  FastLED.setBrightness(2);
  cLEDText ScrollingMsg;
}

void loop() {

  // a bunch of commented FastLED code
  
}

void drawPattern(uint16_t patternArray[], int patternSize, long int colour) {
  uint16_t nextPixel;
  int pixelCounter = 0;
  for (int i = 0; i < NUM_LEDS; i++) {
    for (int j = 0; j < patternSize; j++) {
      nextPixel = pgm_read_word(&patternArray[pixelCounter]);
      if (i == nextPixel) {
        ledmatrix.DrawPixel(floor(i / 8), (i % 8), colour);
        pixelCounter++;
      }
    }
  }
}


void singleLED(int number, int delaytime, long int colour) {
  ledmatrix.DrawPixel(floor(number / 8), (number % 8), colour);
  FastLED.show();
  delay(delaytime);
}

What're my next steps? Where am I tripping up?

Unscaled font possible?

Currently I am trying to work with your library on a LED WS2812b matrix with a LED height of 8 LEDs and 32 LEDs width. I noticed that the Robotron font is "scaled" which leads to unsightly fragments.
As an alternative I converted the Commodore font (8x8) as a header file and inserted it into my project. This has at the bottom of every Byte also (almost) always an empty line of bits e.g. B8(00000000), which is however also scaled/truncated away from the library...?
How can I solve this behavior?
Thanks in advance for help!

4 matrices , 4 pins , 1 text

Hey , I use your LEDText library and would like to be a scrolling over 4 Adafruit WS2812 8x8 LED Pixel Matrix matrices running, each has driven its own pin . I use a Teensy 3.2 and the Octo WS2812 adapter .
Unfortunately no one could help me how do you manage to write a text on all 4 if each its own pin has .
if you need more info just ask.
here is my Code:

`/*There Are 5 Matricies build an Cube
*
*/

include <FastLED.h>

include <LEDMatrix.h>

include <LEDText.h>

include <FontMatrise.h>

define MATRIX_OBEN 20//LED_PIN for Top Matrix

define MATRIX_VORNE 8//LED_PIN for Front Matrix

define MATRIX_RECHTS 7//LED_PIN for Right Matrix

define MATRIX_HINTEN 21//LED_PIN for Back Matrix

define MATRIX_LINKS 6//LED_PIN for Left Matrix

define FARB_REIHENFOLGE GRB// COLOR_ORDER

define LEDTYP WS2812// CHIPSET

define MATRIX_WIDTH 8

define MATRIX_HEIGHT 8

define MATRIX_TYPE VERTICAL_MATRIX

define ANZAHL_LEDS 320//NUM_LED Nummber of Total LED´s

cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;
/*
CRGB ledso[ANZAHL_LEDS/5];// Top Matrix
CRGB ledsv[ANZAHL_LEDS/5];// Front Matrix
CRGB ledsr[ANZAHL_LEDS/5];// Right Matrix
CRGB ledsh[ANZAHL_LEDS/5];// Back Matrix
CRGB ledsl[ANZAHL_LEDS/5];// Left Matrix
*/

cLEDText ScrollingMsg;

const unsigned char TxtDemo[] = { EFFECT_CHAR_LEFT EFFECT_SCROLL_DOWN " EXAmpl"};
void setup()
{
FastLED.addLeds<LEDTYP, MATRIX_OBEN, FARB_REIHENFOLGE>(ledso, ANZAHL_LEDS/5);
FastLED.addLeds<LEDTYP, MATRIX_VORNE, FARB_REIHENFOLGE>(leds[0], leds.Size());
FastLED.addLeds<LEDTYP, MATRIX_RECHTS, FARB_REIHENFOLGE>(leds[0], leds.Size());
FastLED.addLeds<LEDTYP, MATRIX_HINTEN, FARB_REIHENFOLGE>(leds[0], leds.Size());
FastLED.addLeds<LEDTYP, MATRIX_LINKS, FARB_REIHENFOLGE>(leds[0], leds.Size());// now it Shows same on 4 Matricies but i wont 1 text runns around the cube
FastLED.setBrightness(30);
ScrollingMsg.SetFont(MatriseFontData);
ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 1, 0, 0);
ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);
ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0x00, 0x00, 0xff);
FastLED.clear(true);
}

void loop()
{
if (ScrollingMsg.UpdateText() == -1)
ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);
else
FastLED.show();
delay(80);
}`

Sorry for the bad english .. Google translator is to blame .

Change text using buttons

Hi,
I would like to do something quite simlple but i can't make it work !
I'm using switch/case code for making a menu and I would like each item to be a text scroll and each time i press a button i go further in the switch case and the text scroll from start no matter the position of the previous item in the scroll.
Idk if its very clear !
I this code I need to wait the first scroll to finish before being able to see actual item of the menu...

Thanks for your help !

#include <FastLED.h>

#include <LEDMatrix.h>
#include <LEDText.h>
#include <FontMatrise.h>

int range=0;
// Change the next 6 defines to match your matrix type and size

#define LED_PIN        12
#define COLOR_ORDER    GRB
#define CHIPSET        WS2812B

#define MATRIX_WIDTH   11
#define MATRIX_HEIGHT  -10
#define MATRIX_TYPE    HORIZONTAL_MATRIX

cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;

cLEDText ScrollingMsg;

const unsigned char TxtHorl[] = { EFFECT_SCROLL_LEFT "  ITEM 1 " };
const unsigned char TxtHorlHeures[] = { EFFECT_SCROLL_LEFT "  ITEM 2 " };
const unsigned char TxtHorlMin[] = { EFFECT_SCROLL_LEFT "  ITEM 3 " };

void setup()
{
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
  FastLED.setBrightness(6);
  FastLED.clear(true);
     Serial.begin(9600);
  pinMode(2, INPUT_PULLUP);


  
  ScrollingMsg.SetFont(MatriseFontData);
  ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 1, 0, 0);
  ScrollingMsg.SetText((unsigned char *)TxtHorl, sizeof(TxtHorl) - 1);
  ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0xff, 0x00, 0xff);
}


void loop()
{


  switch (range) {
    case 1:    // your hand is on the sensor
       if (ScrollingMsg.UpdateText() == -1)
    ScrollingMsg.SetText((unsigned char *)TxtHorlHeures, sizeof(TxtHorlHeures) - 1);
  else
    FastLED.show();
  delay(100);
      break;
    case 2:    // your hand is close to the sensor
       if (ScrollingMsg.UpdateText() == -1)
    ScrollingMsg.SetText((unsigned char *)TxtHorl, sizeof(TxtHorl) - 1);
  else
    FastLED.show();
  delay(100);
      break;
    case 3:    // your hand is a few inches from the sensor
      if (ScrollingMsg.UpdateText() == -1)
    ScrollingMsg.SetText((unsigned char *)TxtHorlMin, sizeof(TxtHorlMin) - 1);
  else
    FastLED.show();
  delay(100);
      break;
    case 4:    // your hand is nowhere near the sensor
    
      break;
  }

  
 if (digitalRead(2)==LOW  )
  {
    range++;
          Serial.println(range);
delay(150);
    }

  
 
}

programmatically changing colour

Hi
I am using a socket connection to send text etc to a 64x8 neopixel using your excellent library.
I want to change colour by changing the parameters in this line
ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0xff, 0x00, 0xff);
I can for instance externally send a string like "0x45, 0xf1, 0xd5" but have tried all sorts of conversion and concantenation methods to no avail. I simply want to replace the RGB parameters each time with my own. Any advice?
thanks

Freeze on end of text

I am looking for a way to freeze the last portion of the scrolling text. The idea is that the text scrolls in and instead of scrolling all the way through until there is nothing left to show on the matrix, it stops on a "full frame".

Currently I can detect when the last pixel has scrolled of (UpdateText returns -1). Is there a way to detect when there are no more characters left to scroll?

I was thinking about a new property for the class for this that is set somewhere in UpdateText.

Changing the text

is it possible to change the text I want to show for example a score of a metch which will chaneg after time and you are using const char

Creating a xtree matrix

Hi,

Would it be possible to create a xmas tree matrix model as this map:
buitenboom-mapper.xlsx

I would like to use a part of the matrix, say from 58 all the way to 152 without using 90 and 91 and 73,74 and 107.
So that we have a matrix inside the matrix of 6 rows of 15 pixels.

Any hints on this idea ?

KR,

some help please

I am trying to dynamically update a 64x8 display using an ethernet socket connection which provides a string output. I am in a total "meltdown" in relation to unsigned char.... etc
This code throws up error: invalid conversion from 'unsigned char*' to 'char*'

unsigned char TxtDemo[] = { EFFECT_HSV "\x00\xff\xff" };
String txt="my text";
strcat( TxtDemo, txt.c_str() );

ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);

Text TOO Fast

I have been able to get all of the examples working except for one problem, I can not figure out how to slow down the scroll speed. I am using an ESP32

Fonts bigger than ComicSansP24.h, applying multiplier?

With adafruit fonts (which of course offer a lot less than LEDText), I can however use a settextsize(4) to make the font 4 times bigger.
Is that possible at all with LEDText? I didn't see that in the documentation.

I have ComicSansP24.h, but my display is 160 pixels high (no, I don't have that many neopixels, I hacked LEDMatrix to work on any 2D display, including TFTs, as per http://marc.merlins.org/perso/arduino/post_2020-03-16_Framebuffer_GFX_-Choosing-between-its-3-2D-APIs_-FastLED-XY_-NeoMatrix_-and-LEDMatrix_-and-detail-of-its-many-supported-hardware-backends.html )

Any way to make it bigger?

OCTOWS2811 and DmxReceiver

Hi Aaron

I am trying to use the LedMatrix, text and sprite libraries in my sketch together with the DmxReceiver library. I've got serious flickering problems when adding DMX data and was hoping to use the OCTOWS2811 library. FastLED has the feature to do this but it seems the the LedMatrix object does not inherit the correct templates.

To use the Teensy's OCTOWS2811 library with FastLED, one would add leds with this call:

FastLED.addLeds(leds, NUM_LEDS);

But if I do this inside the LEdMatrix sketch, I get this compile error:

no matching function for call to 'CFastLED::addLeds(cLEDMatrix<33, -7, (MatrixType_t)2u>&, int)'

and setting my CHIPSET to OCTOWS2811 with the standard LedMatrix call of:

FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());

gives me this compile error:

no matching function for call to 'CFastLED::addLeds(CRGB*, int)'

I have tested the OCTOWS2811 example and added DMxReceiver to that and it seemed to work.

Can you please suggest how I can go about getting the OCTOWS2811 to wor with LedMatrix?

Mirrored Text

Has anyone run into an issue where the text is mirrored?

How to call out CRGB.leds[i] while using LEDText

Newer to programming, so hope this isn't something overly stupid.

I have the LEDText examples working, so looking to incorportate that into some other code I'm working on.

Per FastLED, I have CRGB leds[NumLeds];

Per LED Matrix/Text I have cLEDMatrix<DisplayWidth, DisplayHeight, HORIZONTAL_ZIGZAG_MATRIX> leds;

These lines both define leds from my understanding.

error: no matching function for call to 'CFastLED::addLeds<WS2812B, 9, GRB>(cLEDMatrix<14, 10, (MatrixType_t)2>&, const uint16_t&)'
   FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NumLeds);
error: wrong number of template arguments (3, should be 2)
   FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NumLeds);
error: lvalue required as left operand of assignment
 leds[35] = CRGB(255 , 0 , 0);

And a ton of others. How do I get CRGB to work with cLEDMatrix?

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.