Pages: 1 ... 14 15 [16] 17 18 19   Go Down
Author Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum  (Read 62799 times)
0 Members and 2 Guests are viewing this topic.
0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's a good practice to declare the functions in the header file. Sometimes, for compilation reasons, these function declarations are mandatory.
Logged

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

Hi all i am fairly new to arduino and i have an arduino uno R3 and the 32x16 matrix from sure electronics.

I used tihs code: http://code.google.com/p/wiseclock2/downloads/detail?name=HT1632.zip&can=2&q...

I tried this post

Quote
Re: SureElectronics 3216 Led Matrix
Reply #26 - 20.12.2010 at 13:38:08 
florinc,

I tried your code and it did nothing that I could see. I am using the latest Arduino 021 environment. I connected the pins as follows:

ht1632_data = 6;  // Data pin (pin 7 of display connector)
ht1632_wrclk = 7; // Write clock pin (pin 5 of display connector)
ht1632_cs = 8;    // Chip Select (pin 1 of display connnector)
ht1632_clk = 9; // clock pin (pin 2 of display connector)
and POWER 5V to (pin 16 of the display connector)
and POWER GND to (pin 15 of the display connector)

I am using USB for power to my Arduino Duemilanove w/328 also.

I did a 'Verify/Compile' command in the Arduino 021 environment displaying a Binary sketch size: 3950 bytes and also did a 'Upload' and the RX TX LEDS on the Arduino were turning on and off as they should during the upload but nothing was displayed.

I also used 2 different known working connectors and neither work in this setup with the display being blank.

From what I can tell from your code, it looks like the Void demo_filler() routine should be running in a loop.

Is there anything I am missing here?

Thanks again!

But i get this error:

Code:
HT1632.cpp:12:22: error: WProgram.h: No such file or directory
HT1632.cpp: In function 'void ht1632_putchar(byte, byte, char, byte)':
HT1632.pde:-1: error: 'myfont' was not declared in this scope

Edit: I found solution for HT1632.cpp:12:22: error: WProgram.h: No such file or directory

WProgram.h had to be Arduino.h

I do not know where to start/look  for the problem.
Can someone please help me?

Thanks!
« Last Edit: March 25, 2012, 09:52:11 am by stekkestim123 » Logged

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

Hi stekkestim123, I am also new in Arduino development and still learning here. I guess you are trying to compile that code using Arduino 1.0 environment. You can try to add this code

Code:
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif

I downloaded the same code and compile it using Arduino 0.23 and found no error. May be you should try to do that as well.
Logged

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

Dear all,

I've got it all working. Really great library! works really simply. I'm now trying to get it work on a Arduino Mega 2560. But with the same IO pins as used on my "UNO" it doesn't work at all. I think there is something different in the pin specification or register specification.

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

Is there already some experiences with the MEGA board. What do I have to change to get it working.

Thanks!
Logged

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

Dear All,

I am very new to Arduino. I selected this project to be my first Arduino project because it is very interesting. I downloaded the library from Evanrich at github: https://github.com/evanrich/Bluetooth-LED-Sign

I am using Arduino 0.23 for Mac OS X. When I try to verify/compile the example Circles sketch in the library i get this error:

Code:
In file included from circles.cpp:1:
/Users/../Arduino/libraries/ht1632c/ht1632c.h:161: error: 'prog_uint16_t' has not been declared
/Users/../Arduino/libraries/ht1632c/ht1632c.h:210: error: ISO C++ forbids declaration of 'prog_uint8_t' with no type
/Users/../Arduino/libraries/ht1632c/ht1632c.h:210: error: expected ';' before '*' token
/Users/../Arduino/libraries/ht1632c/ht1632c.h:211: error: ISO C++ forbids declaration of 'prog_uint16_t' with no type
/Users/../Arduino/libraries/ht1632c/ht1632c.h:211: error: expected ';' before '*' token

What could possibly go wrong? Please help.
Logged

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

@ Tjaah: I haven't worked with a Mega 2560 before but I might guess that the &PortD is the problem. I couldn't find the information somewhere, but I remembered reading that Port F and K are the digital pinouts for the 2560, not certain on that though.

@aero: The library was updated to work with Arduino 1.0, but the circles example (and probably others) is from a much older version of the library. It probably isn't backwards compatible anymore.
Logged

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

@ doubledaffy

Founded it out just seconds before you're reply. pin/port mapping of the mega:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241206933

Then there was my other fault the pins of the actual port do need to be used in the string. Not the names marked on the Arduino board!
So now i am using the pins on the Arduino mega board labled 22, 23, 25, 24(Data, WR, CLK, CS). Makes:
ht1632c dotmatrix = ht1632c(&PORTA, 0, 1, 3, 2, GEOM_32x16, 2);
It works great thanks for you're help and great lib!
Logged

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

Hi Doubledaffy,

Thank you very much for the info. I updated to Arduino 1.0 and test the same "circles" sketch example. It still give errors until I changed this code form "ht1632c.cpp" file.

Original code
Code:
#include "font_b.h"
to
Code:
#include "font.h"

Is it an error in the code? Because I could not find "font_b.h" header file in the repository.

Anyway now I am able to compile the sketch and just have to wait for my Uno to arrive and test it with the board  smiley. Thank you again for your great help.
« Last Edit: March 26, 2012, 05:24:06 pm by aeroII » Logged

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

Hi Doubledaffy,

Thank you very much for the info. I updated to Arduino 1.0 and test the same "circles" sketch example. It still give errors until I changed this code form "ht1632c.cpp" file.

Original code
Code:
#include "font_b.h"
to
Code:
#include "font.h"

Is it an error in the code? Because I could not find "font_b.h" header file in the repository.

Anyway now I am able to compile the sketch and just have to wait for my Uno to arrive and test it with the board  smiley. Thank you again for your great help.

just change it to font.h.   I noticed it too, and it works when you change it.  probably a typo.
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

Hi stekkestim123, I am also new in Arduino development and still learning here. I guess you are trying to compile that code using Arduino 1.0 environment. You can try to add this code

Code:
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif

I downloaded the same code and compile it using Arduino 0.23 and found no error. May be you should try to do that as well.

Thanks! this works
Logged

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

First off I want to thank everyone who put in their hard work to create this library for the ht1632c. Incredible work.

This was my first Arduino project, and other than some minor C programming classes back in middle school (some 15 years ago) a wake-up call to programming.

By picking apart the example code included with the library, and everyone's comments in this forum I was able to get my displays up and running. Did have a few set backs with using outdated info on what pins to connect to on my Arduino Uno, and code not being updated for Arduino 1.0. Other than that it's been a great learning experience.

I was wondering if any of you would mind looking at my code and give me some tips on where I may have gone right/wrong.

Key points:
- Video of working display http://bit.ly/HPPW3J
- I don't yet have a chip to keep time (fingers crossed on my sample request). Because of this, time gets off pretty quickly. I think I saw something about a windows program that can auto-send the time to my arduino. Maybe that will be a temporary option.
- When I remove the usb my display garbles.  Video of error http://bit.ly/HF9DxV
- I hope to incorporate Evanrich's bluetooth/android idea in the future.
- I'm curious on how everyone went about creating some sort of shell to mount these in.
- Would this be a good guide to replace my Arduino once I'm done testing? http://bit.ly/IeBZZm
- PS. Was playing around with running my two displays from my http://isound.net/ 16,000mah battery/charger. Might run some tests to see how  many hours I can get out of running the displays. Might be a good option for creating a mobile platform.

Code:
Code:
/*
 * Mehr Matrix
 * This code was created by Marco Melloni using/modifying example code from the following:
 * ht1632 Library examples http://bit.ly/HCl4W8
 * ht1632 arduino community http://bit.ly/HClcVU
 * Countdown timer example by "siliconfish" http://bit.ly/HCkSWW
 */

#include <Time.h> 
#include <ht1632c.h>

#define TIME_MSG_LEN  11   // time sync to PC is HEADER followed by unix time_t as ten ascii digits
#define TIME_HEADER  'T'   // Header tag for serial time sync message
#define TIME_REQUEST  7    // ASCII bell character requests a time sync message

int daysleft = 0;
int hoursleft = 0;
int minsleft = 0;
int secsleft = 0;

// http://www.epochconverter.com for timeStamp
// DST 2am second Sunday in March -> 2am first Sunday in November
// int timezoneOffset = -28800; //Pacific Standard Time
int timezoneOffset = -25200; //Pacific Daylight Saving Time
signed long eventTimestamp01 = 1342051200 - timezoneOffset; //Comic-Con 2012

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

void setup()  {
  Serial.begin(9600);
  setSyncProvider( requestSync);  //set function to call when sync required
  Serial.println("Waiting for sync message");
  Serial.println("Example T1297674000");

  dotmatrix.clear();
  dotmatrix.pwm(15);
}

void loop(){   
  if(Serial.available() )
  {
    processSyncMessage();
  }
  if(timeStatus()!= timeNotSet)   
  {
    digitalWrite(13,timeStatus() == timeSet); // on if synced, off if needs refresh 
    displayMode();
  }
  else {
    matrixError();
  }
  delay(1000);
}

void matrixError()
{
  dotmatrix.setfont(FONT_5x7W);
  char tmp1[20] = "   ERROR";
  byte len1 = strlen(tmp1);
  for (int i = 0; i < len1; i++)
    dotmatrix.putchar(6*i,  0, tmp1[i], ORANGE);
  dotmatrix.sendframe();

  dotmatrix.setfont(FONT_5x7W);
  char tmp2[20] = "  SET TIME";
  byte len2 = strlen(tmp2);
  for (int i = 0; i < len2; i++)
    dotmatrix.putchar(6*i,  8, tmp2[i], GREEN);
  dotmatrix.sendframe();
  delay(2000);
  dotmatrix.clear();
}

void displayMode()
{
  // Control Current Mode
  matrixCountdown01();
}

void matrixCountdown01()
{
  // Display Event Name
  dotmatrix.setfont(FONT_5x7W);
  char tmp[20] = " COMIC-CON";
  byte len = strlen(tmp);
  for (int i = 0; i < len; i++)
    dotmatrix.putchar(6*i,  0, tmp[i], RED);
  dotmatrix.sendframe();
 
  // Display Countdown
  dotmatrix.setfont(FONT_5x7);
  if (eventTimestamp01 < now()) {
    daysleft = 0;
    hoursleft = 0;
    minsleft =  0;
    secsleft = 0;

    char tmp[20];
    sprintf(tmp, "%02d:%02d:%02d:%02d", daysleft, hoursleft, minsleft, secsleft);
    byte len = strlen(tmp);
    for (int i = 0; i < len; i++)
      dotmatrix.putchar(6*i,  9, tmp[i], GREEN);
    dotmatrix.sendframe();
  }
  else {
    daysleft = (eventTimestamp01 - now())/60/60/24;
    hoursleft = (eventTimestamp01 - now())/60/60 - daysleft*24;
    minsleft = (eventTimestamp01 - now())/60 - hoursleft*60 - daysleft*24*60;
    secsleft = 60 - second();

    char tmp[20];
    sprintf(tmp, "%02d:%02d:%02d:%02d", daysleft, hoursleft, minsleft, secsleft);
    byte len = strlen(tmp);
    for (int i = 0; i < len; i++)
      dotmatrix.putchar(6*i,  9, tmp[i], GREEN);
    dotmatrix.sendframe();
  }
}

void processSyncMessage() {
  // if time sync available from serial port, update time and return true
  while(Serial.available() >=  TIME_MSG_LEN ){  // time message consists of a header and ten ascii digits
    char c = Serial.read() ;
    Serial.print(c); 
    if( c == TIME_HEADER ) {       
      time_t pctime = 0;
      for(int i=0; i < TIME_MSG_LEN -1; i++){   
        c = Serial.read();         
        if( c >= '0' && c <= '9'){   
          pctime = (10 * pctime) + (c - '0') ; // convert digits to a number   
        }
      }   
      setTime(pctime);   // Sync Arduino clock to the time received on the serial port
    } 
  }
}

time_t requestSync()
{
  //Serial.print(TIME_REQUEST,BYTE);  Replaced in Arduino 1.0
  Serial.write( byte(TIME_REQUEST));
  return 0; // the time will be sent later in response to serial mesg
}
« Last Edit: April 13, 2012, 03:42:03 am by cracksmurf » Logged

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

Hi,

I'm completely new to Arduino and C programming, and I am working on several projects on the same time, some of the easy, and others have proven a lot harder that I would've imagined, like getting the 3216 to simply light up.


I finally got that working, but now I'm missing the tricky part… getting the 3216 to actually write something.

I'm using the following code http://code.google.com/p/ht1632c/source/browse/

Basically what I need is to print information I have in an array in the following way:

I need to print the value of this:
int myarray[] = {1, 2, 3, 4, 5, 6};

In the 3216:
1 3 5
2 4 6

Can anyone help me?

Br,
ncubillas

EDIT:
I'm going to try and be more explicit:


When I run this, it returns letter "A"

Code:
int myarray[] = {65, 67, 0, 0, 66, 0};

char char1[3] = {myarray[0]};
  byte len1 = strlen(char1);
  for (int i = 0; i < len1; i++)
     dotmatrix.putchar(5*i,  0, char1[i], GREEN);

I need to print "65" Instead of "A" (ASCII)
« Last Edit: April 14, 2012, 09:36:25 am by ncubillas » Logged

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

When I run this, it returns letter "A"

Code:
int myarray[] = {65, 67, 0, 0, 66, 0};

char char1[3] = {myarray[0]};
  byte len1 = strlen(char1);
  for (int i = 0; i < len1; i++)
     dotmatrix.putchar(5*i,  0, char1[i], GREEN);

I need to print "65" Instead of "A" (ASCII)

You probably have a better understanding of c than me at this point, but I tried my hand at playing around with your array. by changing it to the following I was able to get it to display the numbers from the array. However, it only shows the last number. ie. "65" would display as "5". "67" as "7". Not sure if this is because the array is expecting single digits?

Code:
char myarray[] = {'65','67','0','0','66','0'};
Logged

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

Quote
I need to print "65" Instead of "A" (ASCII)
"65" is a string (that is, a sequence) of 2 characters: '6' and '5'.
To print the 2 characters, call function putchar twice, once for each character:
Code:
dotmatrix.putchar(1,  0, '6', GREEN);
dotmatrix.putchar(9,  0, '5', GREEN);
To define a character, either put it between single quotes or use its ASCII representation (look it up the ASCII table).
Hence
Code:
char c = 'A';
is equivalent to
Code:
char c = 65;

Logged

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

Quote
I hope to incorporate Evanrich's bluetooth/android idea in the future.
Take a look at this post:
http://timewitharduino.blogspot.ca/2012/04/scrolling-message-sign-with-bluetooth.html
Logged

Pages: 1 ... 14 15 [16] 17 18 19   Go Up
Jump to: