Go Down

Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum (Read 65 times) previous topic - next topic

evanrich


Quote


doubledaffy... look here: https://code.google.com/p/ht1632c/  thats the "current" library.  works FANTASTIC for 1, 2 displays, but major issues with 3 or 4.    Performance for 2 displays on an arudino uno is about 122 FPS according to the built in FPS program.   There seems to be a bug however if you use "RIGHT" for text direction, vs "LEFT", where it shows dots remaining at the top and bottom of the text path, almost like a ghost of the top and bottom pixels (forms a straight line across the panels)

If you can't figure out how to use the library, I'll post my code for you, but it's really easy.


evanrich, I'm running into some issues just trying to compile that library. This is the sample code I'm using. I'm also using an Arduino Uno and one 3216 RG board.



Are you using arduino 1.0?  if so pm me your email and I'll send you the fixed library.  can't attach or paste, paste is too long and attachment folder says it's full?
My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

evanrich

florinc, forgive me for being thick, but after reading your site, I still can't figure it out.


on the site, it gives an example of bitmap[7][14].   If i understand correctly, its the number of lines (there are 14 lines in that one pacman character).   
Code: [Select]
uint16_t PROGMEM bitmap[7][14] = {
  {
    0x02E0,    // ____XXXXX_____
    0x0FF8,    // __XXXXXXXXX___
    0x07FC,    // ___XXXXXXXXX__
    0x03FC,    // ____XXXXXXXX__
    0x01FE,    // _____XXXXXXXX_
    0x00FE,    // ______XXXXXXX_
    0x007E,    // _______XXXXXX_
    0x007E,    // _______XXXXXX_
    0x00FE,    // ______XXXXXXX_
    0x01FE,    // _____XXXXXXXX_
    0x03FC,    // ____XXXXXXXX__
    0x07FC,    // ___XXXXXXXXX__
    0x0FF8,    // __XXXXXXXXX___
    0x02E0,    // ___XXXXX______
  },


If I look at the font from the library, there are 8 lines..

Code: [Select]
unsigned char PROGMEM font_8x16[95][14] = {
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //   
{0x0000,0x0000,0x7e02,0x7fe7,0x7e02,0x0000,0x0000,0x0000}, // !


so should it not be
Quote
unsigned char PROGMEM font_8x16[95][8]
?

it looks like it has to be unsigned char, because the existing fonts in the old code (my2font), look like this:
Code: [Select]
unsigned char PROGMEM my2font[256][8]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x00
{0x7E,0x81,0xA9,0x8D,0x8D,0xA9,0x81,0x7E}, // 0x01


again only 8.

Now onto the code.  In the main pde, there is a variable that defines the number of columns:
Code: [Select]
// insert here the number of columns of your font files
// the compiler will comment how large the number of columns
// should be
#define NCOLUMNS 8


my guess is that this should be 8, to match the font variable, correct?  I've tried other values, but the compiler errors if it doesn't match the number in brackets in the font.h file.

The second location in code is this:
Code: [Select]
scrolltextsizexcolor(8,"ABCDEFG    ",1,GREEN, 0,font_8x16,8,8,'T',0);

the font_8x16 is the referenced font name, and then the first 8 is "number of columns", second 8 is "number of rows"

no matter what I try for any of these settings, I either get garbled crap on the screen, or it displays the wrong characters...for example if i enter "ABCDEFG", it shows "abcdefg"... if I enter "!@#$%"...I get "1" followed by a buncha crap.
My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

florinc

The example in the post is not strictly linked to the functions in the HT1632 code you/we are using here. Just showing the principle.

I couldn't find this code you are referring to:
Code: [Select]
unsigned char PROGMEM font_8x16[95][14] = {
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //   
{0x0000,0x0000,0x7e02,0x7fe7,0x7e02,0x0000,0x0000,0x0000}, // !


But, at a glance, this is what I take from it:
1. it is an attempt to define each character as an array of 8 values (as you correctly noticed, should be font_8x16[95][8]);
2. this means that each character is defined as a sequence of columns (one character is 8 columns x 16 rows);
3. to define a column, you need 16 bits; this is more than a char (8 bits), so you would need an unsigned int; therefore, "unsigned char PROGMEM font_8x16" is wrong, it should be "unsigned int PROGMEM font_8x16";

And I did not have an in-depth look at the function "scrolltextsizexcolor", which looks pretty hard-to-understand to me (I did not write that).

You give it a few more tries and if you don't get it working, I will make an effort to dive into that function.

evanrich

My feeble non C brain still can't figure it out, I've tried about 5 different ways of changing stuff, and although it compiles, I get garbage :~  The only way I can get a "big" font, is to scale the text by changing the integer from 1 to 2 in the message, but this is NOT desired, because it slows the display down a lot. really would like to have larger font natively ata 8x15 or 8x16, instead of scaling up 5x7 stuff.

On the other hand, I've started to post all my work on github, if anyone is interested in collaborating, or seeing what I've done, please feel free to take a look at my github page here:https://github.com/evanrich/Bluetooth-LED-Sign

Let me know if you have any questions, I'm going to continue posting stuff all week.
My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

florinc

Evan,
Take a look at the file fontLarge.h. It defines a font 11(wide)x14(high). It also has functions to manipulate it (although I don't think I wrote them myself).

Go Up