Pages: 1 ... 9 10 [11] 12 13 ... 19   Go Down
Author Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum  (Read 60864 times)
0 Members and 1 Guest are viewing this topic.
Coventry UK
Offline Offline
Jr. Member
**
Karma: 1
Posts: 51
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the code I worked out from the Sure Electronics example and some code from the arduino education site:
Code:

//**************************************************************************************************
//Function Name: chipselect
//Function Feature: choose the chipset in which work
//Input Argument: number of the chip
//Output Argument: void
// A negative value will enable all of the HT1632Cs
// A value of 0 will disable all HT1635Cs
// A value between 1 and CHIP_MAX will enable the required HT1632C (numbers greater than CHIP_MAX are not tested for
//**************************************************************************************************
void chipselect(int chip)
{
  if(chip < 0) // enable all HT1632Cs
  {
    digitalWrite(CS, LOW);
    for(int tmp = 0; tmp < CHIP_MAX; tmp++)
    {
      digitalWrite(CLK, HIGH);
      digitalWrite(CLK, LOW);
    }
    digitalWrite(CS, HIGH); // Restore cs to default state
  }
  else if (chip == 0)  // disable all HT1632Cs
  {
    digitalWrite(CS, HIGH);
    for(int tmp=0; tmp<CHIP_MAX; tmp++)
    {
      digitalWrite(CLK, HIGH);
      digitalWrite(CLK, LOW);
    }
  }
  else
  {
      for( int tmp = CHIP_MAX; tmp >= 1; tmp--)
      {
        if(tmp == chip)
        {
          digitalWrite(CS,LOW);
        }
        else
        {
          digitalWrite(CS,HIGH);
        }
        digitalWrite(CLK, HIGH);
        digitalWrite(CLK, LOW);
      }
      digitalWrite(CS,HIGH);
  }
}

I don't have more than 1 display to test it with though.

Martyn.
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

evanrich or JoeShearn,

I'm getting into this a little late since the original stuff was started around a year ago.  Can either of you supply working libraries and sample code so that I can hook up 1 or 2 of these LED modules and get crackin?

No sense re-inventing the wheel. I've worked with the 32x8 boards from sure electronics before, but the CS on these bigger ones seems to have been a whole process to work through.

Thanks

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

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Transient Explorer
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
Arduino rocks (by default)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I'll take a look. The documentation looks like it's straight forward enough to work with. I was just previously unable to find the most recent version to start working with.

I'll keep you posted on progress.
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I'll take a look. The documentation looks like it's straight forward enough to work with. I was just previously unable to find the most recent version to start working with.

I'll keep you posted on progress.

looking forward to it.   2 displays is great, but I and others really need 3 or more.   for my use, i only require up to 4 to work, some ppl were looking for 8..   

If you can get it working i'd be happy to paypal you some dough for your efforts =)
Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not take an in-depth look at the latest (OO, generalized) library, since I find it too complicated for my simple mind (I don't mean to offend anyone).
With older libraries I see no issues for a 3-display setup (I don't have a 4th display unfortunately).
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not take an in-depth look at the latest (OO, generalized) library, since I find it too complicated for my simple mind (I don't mean to offend anyone).
With older libraries I see no issues for a 3-display setup (I don't have a 4th display unfortunately).


The old libraries were a little slow, due to having to expand the font using the size integer to 2 to get 8x16 fonts.   I haven't been able to figure out how to get 8x16 fonts with the old code.

Also, I tried pulling one of the old code zips, and when I hook up 3 displays, text only shows on 1.  If I dissconnect the 3rd display, text shows on 2, but when i reconnect the 3rd, only the first display works.   Do you have verified working old code?  

FYI, I'm using an external 1 A wall-wart to power the arduino, so 3 should not be an issue (the on-board regulator is rated for 1A out, and the displays only draw around 250ma each.)  I also know the 3rd display isn't bad, because I can hook either 2 together and it works...only when hooking the 3rd display up do I have issues.    If someone has working old code for 3+ displays, could you post it again?

« Last Edit: January 08, 2012, 03:34:17 am by evanrich » Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is what I got for 3 displays:


Quote
I haven't been able to figure out how to get 8x16 fonts with the old code.
You need to define those yourself or copy the definitions from some other place/code. Expanding the font isn't really a great idea.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Florinc

Could you tell us which lib exactly you're using?
Which arduino?
What kind of power?

Would love to test it with my 4 displays.

thanks
Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I started by using the library referenced on the first page of this long posting. I modified it a bit along the way, but it is essentially the same.
I am using my own board, "branded" Wise Clock 4, and available as a kit (among other kits) here:
http://timewitharduino.blogspot.com/2011/11/buy-wise-clock-4-kit.html
As for power, nothing special (external), just the power supplied by the USB, through the USB cable and FTDI breakout. This is not a setup you would use for an industrial/commercial application anyway, just for this particular test. As you noticed from the above video, to keep the current down I only light up a pixel at a time (except for the scrolling).
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Crap...  I wonder if I might have a bad display then...  I've got some of the larger 5mm displays arriving in a few days (the size for my final prototype) i'll have to see if those work better.
Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I wonder if I might have a bad display then
You can swap them and see if the result is the same. Just another idea until you get your 5mm displays smiley
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, I had a bad display.  I tried swapping them around..was really strange.  If i had any 2/3 (only had 3) connected together, they both worked fine.   But if I hooked all 3 together (tried different combinations), weird stuff happened.

I got my 5mm display in today (and it's HUGE), hooked that up with the 2 I suspected were good, and all works fine.  My guess is either a short on the pins of one of the HT1632C's or something wrong in the traces, because the board looks physically ok...

I now need to figure out a 16pt font to use to fill the display (using these for an in-car message board).

Do you know how to get 16pt fonts for the old code?   I tried taking one of the font_8_16 blocks from the new library (looked almost the same as the old code's font2/3.h) and created a new "font4.h", including it in the old code, but when I try to use it (change the rows to 16, instead of 8x8), i just get garbled crap on the displays. 

I've tried searching the net for 8x16 font .h files to use, but haven't found any.


Thanks florinc!
Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at this post:
http://timewitharduino.blogspot.com/2011/06/how-to-define-fonts-and-bitmaps.html
At the bottom, there is an example on how to define bigger (than 8x8) bitmaps.
Use the same method to define your big font.
Instead of
Code:
uint16_t PROGMEM bitmap[7][14]
you will have
Code:
uint16_t PROGMEM bitmap[number_of_characters_in_the_set][16]
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm

Ok I'll try that  I was copying the code from the new font file, tried pasting this:

Code:
uint16_t PROGMEM font_8x16[95][8] = {
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //   
{0x0000,0x0000,0x7e02,0x7fe7,0x7e02,0x0000,0x0000,0x0000}, // !
{0x0000,0xc800,0xf000,0x0000,0xc800,0xf000,0x0000,0x0000}, // "
{0x0020,0x083e,0x0fe0,0x7820,0x083e,0x0fe0,0x7820,0x0800}, // #
{0x1c38,0x2224,0x4104,0xffff,0x4104,0x2888,0x1870,0x0000}, // $
{0x3c03,0x421c,0x4260,0x3dbc,0x0642,0x3842,0xc03c,0x0000}, // %
{0x0038,0x3cc4,0x4304,0x44e4,0x3918,0x01e8,0x0104,0x0000}, // &
{0xc800,0xc800,0xf000,0x0000,0x0000,0x0000,0x0000,0x0000}, // '
{0x0000,0x0000,0x0000,0x0ff0,0x300c,0x4002,0x8001,0x0000}, // (
{0x8001,0x4002,0x300c,0x0ff0,0x0000,0x0000,0x0000,0x0000}, // )
{0x06c0,0x0280,0x0920,0x1ff0,0x0920,0x0280,0x06c0,0x0000}, // *
{0x0100,0x0100,0x0100,0x1ff0,0x0100,0x0100,0x0100,0x0000}, // +
{0x0019,0x0019,0x001e,0x0000,0x0000,0x0000,0x0000,0x0000}, // ,
{0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0000}, // -
{0x000c,0x001e,0x000c,0x0000,0x0000,0x0000,0x0000,0x0000}, // .
{0x0003,0x000c,0x0030,0x01c0,0x0e00,0x3000,0xc000,0x0000}, // /
{0x0000,0x0ff0,0x300c,0x4002,0x4002,0x300c,0x0ff0,0x0000}, // 0
{0x0000,0x2004,0x2004,0x7ffc,0x0004,0x0004,0x0000,0x0000}, // 1
{0x0000,0x180c,0x2834,0x4044,0x4184,0x2204,0x1c1c,0x0000}, // 2
{0x1830,0x2008,0x4104,0x4104,0x4104,0x2288,0x1c70,0x0000}, // 3
{0x01c0,0x0640,0x1844,0x2044,0x7ffc,0x0044,0x0040,0x0000}, // 4
{0x7f30,0x4228,0x4404,0x4404,0x4404,0x4208,0x01f0,0x0000}, // 5
{0x0ff0,0x3108,0x4204,0x4204,0x4204,0x5108,0x30f0,0x0000}, // 6
{0x7000,0x4000,0x4000,0x401e,0x41e0,0x4e00,0x7000,0x0000}, // 7
{0x1c70,0x2288,0x4104,0x4104,0x4104,0x2288,0x1c70,0x0000}, // 8
{0x1e10,0x2108,0x4084,0x4084,0x4084,0x2108,0x1ff0,0x0000}, // 9
{0x0000,0x0000,0x060c,0x060c,0x060c,0x0000,0x0000,0x0000}, // :
{0x0000,0x0000,0x0619,0x061f,0x061c,0x0000,0x0000,0x0000}, // ;
{0x0000,0x0000,0x0180,0x0660,0x1818,0x6006,0x8001,0x0000}, // <
{0x0440,0x0440,0x0440,0x0440,0x0440,0x0440,0x0440,0x0000}, // =
{0x8001,0x6006,0x1818,0x0660,0x0180,0x0000,0x0000,0x0000}, // >
{0x1800,0x2800,0x4002,0x4067,0x4082,0x2300,0x1c00,0x0000}, // ?
{0x1ff0,0x2008,0x47c4,0x4824,0x4824,0x4444,0x3fe8,0x0000}, // @
{0x003c,0x07c4,0x3840,0x4040,0x3840,0x07c4,0x003c,0x0000}, // A
{0x4004,0x7ffc,0x4104,0x4104,0x4104,0x2284,0x1c78,0x0000}, // B
{0x0fe0,0x3018,0x4004,0x4004,0x4004,0x2004,0x7038,0x0000}, // C
{0x4004,0x7ffc,0x4004,0x4004,0x4004,0x3018,0x0fe0,0x0000}, // D
{0x4004,0x7ffc,0x4104,0x4104,0x47c4,0x4004,0x703c,0x0000}, // E
{0x4004,0x7ffc,0x4104,0x4104,0x47c0,0x4000,0x7000,0x0000}, // F
{0x07e0,0x1818,0x2008,0x4004,0x4104,0x2108,0x71fc,0x0100}, // G
{0x4004,0x7ffc,0x4204,0x0200,0x0200,0x4204,0x7ffc,0x4004}, // H
{0x4004,0x4004,0x4004,0x7ffc,0x4004,0x4004,0x4004,0x0000}, // I
{0x0070,0x0008,0x0004,0x4004,0x4004,0x4008,0x7ff0,0x4000}, // J
{0x4004,0x7ffc,0x4204,0x0300,0x0cc0,0x7030,0x400c,0x0004}, // K
{0x4004,0x7ffc,0x4004,0x4004,0x0004,0x0004,0x003c,0x0000}, // L
{0x7ffc,0x2004,0x1c00,0x0380,0x1c00,0x2004,0x7ffc,0x0000}, // M
{0x7ffc,0x2004,0x1c00,0x0380,0x0070,0x4008,0x7ffc,0x4000}, // N
{0x1ff0,0x2008,0x4004,0x4004,0x4004,0x2008,0x1ff0,0x0000}, // O
{0x4004,0x7ffc,0x4084,0x4084,0x4080,0x2100,0x1e00,0x0000}, // P
{0x0fe0,0x3018,0x4024,0x4024,0x4026,0x3019,0x0fe1,0x0000}, // Q
{0x4004,0x7ffc,0x4104,0x4100,0x4180,0x2270,0x1c0c,0x0004}, // R
{0x1c7c,0x2208,0x4204,0x4104,0x2104,0x7088,0x0070,0x0000}, // S
{0x7000,0x4004,0x4004,0x7ffc,0x4004,0x4004,0x7000,0x0000}, // T
{0x4000,0x7ff8,0x4004,0x0004,0x0004,0x4004,0x7ff8,0x4000}, // U
{0x7c00,0x43c0,0x0030,0x000c,0x0030,0x43c0,0x7c00,0x0000}, // V
{0x7fe0,0x401c,0x00e0,0x0700,0x00e0,0x401c,0x7fe0,0x0000}, // W
{0x400c,0x7034,0x4dc0,0x0200,0x4dc0,0x7034,0x400c,0x0000}, // X
{0x6000,0x5c04,0x0304,0x00fc,0x0304,0x5c04,0x6000,0x0000}, // Y
{0x700c,0x4034,0x40c4,0x4704,0x5804,0x6004,0x403c,0x0000}, // Z
{0x0000,0x0000,0x0000,0xffff,0x8001,0x8001,0x8001,0x0000}, // [
{0x6000,0x1800,0x0600,0x0180,0x0060,0x0018,0x0006,0x0000}, // "\"
{0x8001,0x8001,0x8001,0xffff,0x0000,0x0000,0x0000,0x0000}, // ]
{0x1000,0x2000,0x4000,0x8000,0x4000,0x2000,0x1000,0x0000}, // ^
{0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0000}, // _
{0x0000,0x0000,0xf000,0xc800,0x0000,0x0000,0x0000,0x0000}, // `
{0x0038,0x0244,0x0484,0x0484,0x0484,0x0488,0x03fc,0x0004}, // a
{0x4000,0x7ffc,0x0404,0x0404,0x0404,0x0208,0x01f0,0x0000}, // b
{0x01f0,0x0208,0x0404,0x0404,0x0404,0x0204,0x0718,0x0000}, // c
{0x01f0,0x0208,0x0404,0x0404,0x0404,0x7ffc,0x4004,0x0000}, // d
{0x01f0,0x0288,0x0484,0x0484,0x0484,0x0284,0x0198,0x0000}, // e
{0x0400,0x0404,0x0404,0x3ffc,0x4404,0x4404,0x4400,0x2000}, // f
{0x000e,0x03b1,0x0451,0x0451,0x0451,0x0389,0x0406,0x0400}, // g
{0x4004,0x7ffc,0x0204,0x0400,0x0400,0x0404,0x03fc,0x0004}, // h
{0x0004,0x0404,0x0404,0xc404,0xc7fc,0x0004,0x0004,0x0004}, // i
{0x000c,0x0002,0x0401,0x0401,0x0401,0xc402,0xc7fc,0x0000}, // j
{0x4004,0x7ffc,0x0044,0x0080,0x0180,0x0260,0x041c,0x0004}, // k
{0x0004,0x4004,0x4004,0x4004,0x7ffc,0x0004,0x0004,0x0004}, // l
{0x03fc,0x0404,0x0400,0x03fc,0x0404,0x0400,0x03fc,0x0004}, // m
{0x0404,0x07fc,0x0204,0x0400,0x0400,0x0404,0x03fc,0x0004}, // n
{0x01f0,0x0208,0x0404,0x0404,0x0404,0x0208,0x01f0,0x0000}, // o
{0x0401,0x07ff,0x0409,0x0409,0x0408,0x0210,0x01e0,0x0000}, // p
{0x01e0,0x0210,0x0408,0x0409,0x0409,0x07ff,0x0401,0x0000}, // q
{0x0404,0x0404,0x07fc,0x0204,0x0404,0x0404,0x0300,0x0000}, // r
{0x001c,0x0388,0x0444,0x0444,0x0444,0x0244,0x0738,0x0000}, // s
{0x0400,0x0400,0x3ff8,0x0404,0x0404,0x0404,0x0018,0x0000}, // t
{0x0400,0x07f8,0x0004,0x0004,0x0004,0x0408,0x07f8,0x0004}, // u
{0x0700,0x04e0,0x0018,0x0004,0x0018,0x04e0,0x0700,0x0000}, // v
{0x07e0,0x001c,0x0060,0x0780,0x0060,0x001c,0x07e0,0x0000}, // w
{0x0404,0x060c,0x05b4,0x0040,0x05b4,0x060c,0x0404,0x0000}, // x
{0x0406,0x0601,0x0582,0x004c,0x0030,0x04c0,0x0700,0x0400}, // y
{0x0004,0x060c,0x0414,0x0464,0x0584,0x0604,0x041c,0x0000}, // z
{0x0000,0x0000,0x0100,0x0280,0x7c7e,0x8001,0x8001,0x0000}, // {
{0x0000,0x0000,0x0000,0xffff,0x0000,0x0000,0x0000,0x0000}, // |
{0x8001,0x8001,0x7c7e,0x0280,0x0100,0x0000,0x0000,0x0000}, // }
{0x4000,0x8000,0x8000,0x4000,0x2000,0x2000,0x4000,0x0000}, // ~
};


BTW, for anyone interesting, this is what I'm working on  first shot is basically 3 Sure boards, but all on one board,  the second shot is the "controller".   



Features:
-Atmega328p (QFN)
-FTDI FT232RQ
-MAX17043 1S Fuel guage (tell how much battery is left)
-Bluetooth SPP Module (Dealextreme)
1.0A+ Boost Converter (3.7V lithium pack to 5v for displays)
500ma LiPo Battery Charger (via USB)


power supplies are on the back, controller/Bluetooth on the front.  I designed it (after about 10 paper prints, and 2 BatchPCB runs) so that it mates perfectly in the 3216 (3mm) boards "Input" header, with one screw to allow for securing to the board, if desired.  In testing previous prototypes, I can get roughly 4-6 hours off a 2700mah battery driving 2 displays + everything on board non stop (displaying text on the displays repeatedly)
« Last Edit: January 10, 2012, 11:17:59 am by evanrich » Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Code:
#include <ht1632c.h>

void setup(){
    ht1632c ledMatrix = ht1632c(PORTD, 9, 8, 7, 6, GEOM_32x16, 1);
}

void loop (){
    ht1632c.plot(14,14,1);
}

Now when I try to compile I get these errors:
Code:
In file included from SampleLibrary.cpp:1:
C:\Users\Owner\Desktop\Arduino\libraries\HT1632/ht1632c.h:9:22: error: WProgram.h: No such file or directory
In file included from SampleLibrary.cpp:1:
C:\Users\Owner\Desktop\Arduino\libraries\HT1632/ht1632c.h:133: error: 'byte' has not been declared
C:\Users\Owner\Desktop\Arduino\libraries\HT1632/ht1632c.h:145: error: expected class-name before '{' token
C:\Users\Owner\Desktop\Arduino\libraries\HT1632/ht1632c.h:153: error: expected ',' or '...' before 'geometry'
C:\Users\Owner\Desktop\Arduino\libraries\HT1632/ht1632c.h:153: error: ISO C++ forbids declaration of 'byte' with no type

I was wondering if you or anyone could help me out?
« Last Edit: January 10, 2012, 06:06:16 pm by AznPrince » Logged

The Appearance of Reason Induces Compliance

Pages: 1 ... 9 10 [11] 12 13 ... 19   Go Up
Jump to: