Pages: 1 ... 11 12 [13] 14 15 ... 19   Go Down
Author Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum  (Read 63896 times)
0 Members and 1 Guest are viewing this topic.
Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Closer..

Opened the largeFont.zip from the link, compiled it, but get an error:

Code:
ht1632_suretest.cpp: In function 'int ht1632_putLargeChar(int, int, char, byte)':
ht1632_suretest:1467: error: 'PUTINSNAPSHOTRAM' was not declared in this scope


went back through the sketch, do not see a reference to "PUTINSNAPSHOTRAM".   if I delete that variable, when running the scrolllargetext, it just fills the panels with green leds, so I'm sure that has something to do with it.

edit:

Found it, in the ht1632c.h file in your wiseclock3 zip, there was a reference that defined it as 0x10.

https://code.google.com/p/wiseclock2/downloads/detail?name=Wiseclock3_Dec2011.zip&can=2&q=

didn't bring my stuff to work, so will try this when I get home.
« Last Edit: February 02, 2012, 12:45:51 pm 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

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

florinc!


Success!!!!  works great.   I need to send you a PM regarding using your code in my repo

Thanks alot!
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

Feel free to use it.
I am glad I could help.
Logged

Coventry UK
Offline Offline
Jr. Member
**
Karma: 1
Posts: 51
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been trying to use the HT1632 library with my single panel and have been having problems with corruption when I do the initialisation and say I'm using 1 panel:

ht1632c dotmatrix = ht1632c(PORTD, 7, 6, 4, 5, GEOM_32x16, 1);

but the screen corruption goes away if I use

ht1632c dotmatrix = ht1632c(PORTD, 7, 6, 4, 5, GEOM_32x16, 2);


I've been looking at the code in ht1632c.cpp and am a bit puzzled by:

Code:
ht1632c::ht1632c(const byte geometry, const byte number)
{
  if (geometry != GEOM_32x16) return;
  bicolor = true;
  x_max = (32 * number) - 1;
  y_max = 15;
  cs_max = 4 * number;
  framesize = 32 * cs_max;
  framebuffer = (byte*) malloc(framesize);
  setfont(FONT_5x7W);
  x_cur = 0;
  y_cur = 0;

  _data_out();
  _wr_out();
  _clk_out();
  _cs_out();
  setup();
}

In particular this line of code:
framesize = 32 * cs_max;

I thought thought that each HT3216c controlled 64 bytes of memory 0x40 so is my screen corruption being caused by having a buffer half the length that it should be?

Martyn.
Logged

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

can you post a video or photo of your issue?  that code doesn't have any issues with 1 display for everyone else, so it might be something you're doing wrong.
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

I'm still trying to get up to speed here a bit. I've got it up and running on 1.0 now (thanks evanrich), but I get really dim LED's. I'm just connected over USB (with an ethernet shield that isn't used in the code...yet).

Very simple code
Code:
#include <ht1632c.h>

//PORT, data, wr, clk, cs
ht1632c dotmatrix = ht1632c(PORTD, 7, 6, 4, 5, GEOM_32x16, 2);

void setup() {
  dotmatrix.clear();
}

void loop() {
  dotmatrix.hscrolltext(6, "Scrolling...", 2, 10, 3, 0);

 
}

I just have the ribbon cables connected to the 5v and gnd of the arduino, I figured the current should be plenty.
Logged

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

check your PWM setting, if you're getting dim displays, chances are the brightness is set down low.  Add the following to your SETUP after you call .clear.

Code:
dotmatrix.pwm(15);
« Last Edit: February 08, 2012, 12:02:33 pm 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

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

That's what I figured, and it works. Thanks.
Logged

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

There's a horizontal/vertical scroll function, but is there a static text one? I know there is the "write" function, but that doesn't seem to include controls for X,Y location or text color, or the length of time to display the text.

Before I go reinventing the wheel, do you guys know of one that already exists?

And while I'm at it, do you use up ~15kb with just the library and initializing boards to control?! That's half my memory and I still have to use ethernet controls!
« Last Edit: February 08, 2012, 03:43:50 pm by doubledaffy » Logged

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



There should be a "putchar" function, you can use that to define x,y,color, something like :

dotmatrix.putchar(0,0,GREEN,"H");
dotmatrix.putchar(0,8,GREEN,"E");
dotmatrix.putchar(0,16,GREEN,"Y");
.
.
.
etc.  

Here:
Quote
putchar(int x, int y, char c, byte color, byte attr)

And no, the library does not use 15K of code space...it gets compiled down to machine code.  My average sketch is around 8-10K for everything, arduino .ino/pde + libraries + font.    8K font + 15K .INO/.PDE + 20K library = ~8-10K atmel code.

you only compile the functions you use from the libraries.   I can fit my whole project, which includes bluetooth handling, 3 font files, library, entire sketch, etc, into a 13K hex file.    Believe me, on a ATMega328p, there is a TON of space left over.    If you used every library supplied with arduino, plus font files, plus your code, I'm sure you'd be hard pressed to even hit 20k worth of memory space...
« Last Edit: February 08, 2012, 06:57:39 pm 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

Quote
If you used every library supplied with arduino, plus font files, plus your code, I'm sure you'd be hard pressed to even hit 20k worth of memory space...
That would be nice....
OpenLog library (serial logger to SD card) takes all of the 30KB left.
Logged

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

I was being a little sarcastic, but damn...30k for data logging?   Iguess SD cards require a lot of computing power smiley


Edit: Ok just checked, my new working code (with florinc's help) totals 222KB for all files combined in the sketch folder.   When compiled and uploaded, the status window says
Quote
Binary sketch size: 8492 bytes (of a 32256 byte maximum)

so as you can see, compiled code is much smaller.
« Last Edit: February 09, 2012, 02:16:55 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
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@doubledaffy

I wrote this. It doesn't support multi-line though.
w is the width of the font

Code:
void placetext(int x, int y, char *text, byte color, byte w){
  int len = strlen(text);
  for (int i = 0; i < len; i++){
    ledMatrix.putchar(x + w * i,  y, text[i], color);
  }
  ledMatrix.sendframe();
}

BTW. My sketch compiles to 26630 bytes and I'm also using ethernet and the ht1632 lib.
Logged

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

@ evanrich:  I don't know how you do that because when I just use the example code for "circles" I get 15,458 bytes when compiling. Most of that comes from that second line of code where the dotmatrix is declared. If you know a way to reduce that, I'll certainly take suggestions.

Code:
#include <ht1632c.h>
//PORT, data, wr, clk, cs
ht1632c dotmatrix = ht1632c(PORTD, 7, 6, 4, 5, GEOM_32x16, 2);
void setup() {
  dotmatrix.clear();
}

void loop() {
  int x = random(1, dotmatrix.x_max);
  int y = random(1, dotmatrix.y_max);
  byte color = random(1,4);
  for (byte rad = 1; rad < dotmatrix.y_max; rad ++) {
    if ((x+rad > dotmatrix.x_max) || (y+rad > dotmatrix.y_max)) break;
    if ((x-rad <= 0) || (y-rad < 0)) break;
    dotmatrix.circle(x,y,rad,color);
    dotmatrix.sendframe();
    delay(100);
    dotmatrix.circle(x,y,rad,0);
    dotmatrix.sendframe();
  }
}

@ mezelve: Thanks for the code. I was going to do something similar with that. I'm going to work on some added functionality so that it will wrap to the boards for multiple lines, and also scroll if the whole thing one fit. I'll make sure to get back to you guys about it.
Logged

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

is this with the library, or the old code?  I'll check tonight when I get home
Logged

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

Pages: 1 ... 11 12 [13] 14 15 ... 19   Go Up
Jump to: