New York
Offline
Full Member
Karma: 2
Posts: 231
xronosclock.com
|
 |
« on: November 08, 2012, 02:59:17 pm » |
I'm trying to get HT1632 library ( this one) to work with my Sure 32x16 LED display. I've connected it to my Aruduino Uno3 and tested following this wonderful and extremely helpful tutorial. Pong game works, I can plot individual dots, etc. However when I tried using Gaurav Manek's HT1632 library, I'm not getting any life signs from the LED board  My connections mapping to arduino are as follow: CS = pin 8 CLK = pin 9 WR = pin 7 DATA = pin 6 Here's the code, taken streight from the Github: #include <font_5x4.h> #include <HT1632.h>
int pinCS1 = 8; int pinCS2 = 9; int pinWR = 7; int pinDATA = 6;
int wd; int i = 0;
void setup () { HT1632.begin(pinCS1, pinCS2, pinWR, pinDATA); wd = HT1632.getTextWidth("Hello, how are you?", FONT_5X4_WIDTH, FONT_5X4_HEIGHT); }
void loop () { // Select board 1 as the target of subsequent drawing/rendering operations. HT1632.drawTarget(BUFFER_BOARD(1)); HT1632.clear();
HT1632.drawText("Hello, how are you?", 2*OUT_SIZE - i, 2, FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
HT1632.render(); // Board 1's contents is updated.
// Select board 2 as the target of subsequent drawing/rendering operations. HT1632.drawTarget(BUFFER_BOARD(2)); HT1632.clear();
HT1632.drawText("Hello, how are you?", OUT_SIZE - i, 2, FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
HT1632.render(); // Board 2's contents is updated.
i = (i+1)%(wd + OUT_SIZE * 2); // Make it repeating. } It compiles but nothing happens on the screen  Any suggestions? Is there a better library out there?
|
|
|
|
|
Logged
|
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info 
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 86
Posts: 9359
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #1 on: November 08, 2012, 03:20:33 pm » |
Wha if you added a delay(1000) after every display action? it might just be that you update too fast, resulting in very fast clears() ... or make it elementary #include <font_5x4.h> #include <HT1632.h>
// just to keep them as small as possible :) uint8_t pinCS1 = 8; uint8_t pinCS2 = 9; uint8_t pinWR = 7; uint8_t pinDATA = 6; uint8_t wd;
void setup () { HT1632.begin(pinCS1, pinCS2, pinWR, pinDATA); wd = HT1632.getTextWidth("Hello, how are you?", FONT_5X4_WIDTH, FONT_5X4_HEIGHT);
HT1632.drawTarget(BUFFER_BOARD(1)); HT1632.clear();
HT1632.drawText("Hello, how are you?", 2*OUT_SIZE - i, 2, FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
HT1632.render(); // Board 1's contents is updated. }
void loop () {}
|
|
|
|
|
Logged
|
|
|
|
|
New York
Offline
Full Member
Karma: 2
Posts: 231
xronosclock.com
|
 |
« Reply #2 on: November 08, 2012, 03:26:52 pm » |
Wha if you added a delay(1000) after every display action?
it might just be that you update too fast, resulting in very fast clears() ...
or make it elementary
Still nothing  BTW had to remove "i" from your code...
|
|
|
|
|
Logged
|
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info 
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 86
Posts: 9359
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #3 on: November 08, 2012, 03:44:24 pm » |
BTW had to remove "i" from your code Code was not tested, but you got the idea. Strange it does not do anything. Has it a self test modus/ splash screen? Or can the string be too long? (guessing)
|
|
|
|
|
Logged
|
|
|
|
|
New York
Offline
Full Member
Karma: 2
Posts: 231
xronosclock.com
|
 |
« Reply #4 on: November 09, 2012, 07:46:12 am » |
Still not having much luck. Frankly this phrase from the library doc doesn't make sense to me: HT1632 is always initialized by calling the begin function, like so:
HT1632.begin(pinCS1 [, pinCS2 [, pinCS3 [, pinCS4]]], pinWR, pinDATA);
What about Clock pin? Where is it defined? Maybe I'm not wiring it correctly? My display has 5 usable pins, CS, CLK, WR and DATA, and I know it's pretty standard...
|
|
|
|
|
Logged
|
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info 
|
|
|
|
0
Offline
Edison Member
Karma: 6
Posts: 1399
Arduino rocks
|
 |
« Reply #5 on: November 09, 2012, 08:14:27 am » |
This comment is from HT1632.h: HT1632.h - Library for communicating with the popular HT1632/HT1632C LED controllers. This library provides higher-level access (including text drawing) for these chips. Currently, the library supports writing to a single chip at a time, and has been tested with a single Sure Electronics 3208 5mm red board.
|
|
|
|
|
Logged
|
|
|
|
|
New York
Offline
Full Member
Karma: 2
Posts: 231
xronosclock.com
|
 |
« Reply #6 on: November 09, 2012, 08:33:23 am » |
This comment is from HT1632.h: HT1632.h - Library for communicating with the popular HT1632/HT1632C LED controllers. This library provides higher-level access (including text drawing) for these chips. Currently, the library supports writing to a single chip at a time, and has been tested with a single Sure Electronics 3208 5mm red board. I assumed author just didn't update the text. It contradicts itself in more than one place, for example: This library supports up to 4 chips at a time (though technically more can be run concurrently). To take advantage of this, specify multiple CS pins in the initialization. Taken from: https://github.com/gauravmm/HT1632-for-Arduino  BTW florinc, I just tried your library from WiseClock2 ( http://code.google.com/p/wiseclock2/downloads/detail?name=HT1632.zip&can=2&q=#makechanges) and it works for my setup! I'm still figuring it out, biggest issue is terrible flicker... I'm displaying letter in some COLOR then displaying same letter in BLACK color, then moving it, etc. Am I going about it wrong?
|
|
|
|
« Last Edit: November 09, 2012, 08:58:02 am by bratan »
|
Logged
|
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info 
|
|
|
|
New York
Offline
Full Member
Karma: 2
Posts: 231
xronosclock.com
|
 |
« Reply #7 on: November 09, 2012, 06:20:54 pm » |
Phew, got it working! Well not the library, I abandoned all hope, but Florinc's code and it's derivatives are awesome! I even wrote my own text processor (it shows large clock digits), but all the other backend stuff I left as it was, with exception of adding brightness control: #define LEDBrightness 8 // Set Brightness of teh display from 1-15 ht1632_sendcmd(j, HT1632_CMD_PWM +LEDBrightness); /* Set Brightness */ I was actually shocked that it worked, as I was just guessing  Biggest issue is that clear screen function really messes up everything big time, and I don't understand why. Every time I use it RTC clock stops working (that's the strangest part) and I get artifacts on the screen that won't go away... So I'm only using it the setup and only in the very beginning, before RTC initialization. If anyone interested I'll post sketch, but I'll need to tidy it, cause it's a mess right now...
|
|
|
|
|
Logged
|
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info 
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 86
Posts: 9359
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #8 on: November 09, 2012, 06:29:15 pm » |
we are always interested in end results here for future reference. Tidying the code up first is also a good idea.
Idea: the : between the hours can flash in the first 20 seconds the upper dot only, the next 20 the lower one and the last 20 seconds both dots. Gives just a bit more precise timing.
|
|
|
|
|
Logged
|
|
|
|
|
New York
Offline
Full Member
Karma: 2
Posts: 231
xronosclock.com
|
 |
« Reply #9 on: November 09, 2012, 10:14:12 pm » |
we are always interested in end results here for future reference. Tidying the code up first is also a good idea.
Idea: the : between the hours can flash in the first 20 seconds the upper dot only, the next 20 the lower one and the last 20 seconds both dots. Gives just a bit more precise timing.
Cool idea! Should be easy to implement, thanks!
|
|
|
|
|
Logged
|
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info 
|
|
|
|
|