Pages: [1]   Go Down
Author Topic: need some help with errors  (Read 1243 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i got an error thats said
Code:
In file included from sketch_feb14a_pde.cpp:8:
/ht1632.h:1:86: error: missing binary operator before token "#"
/ht1632.h:1:1: error: unterminated #if
sketch_feb14a_pde.cpp: In function 'void ht1632_chipselect(byte)':
sketch_feb14a_pde:27: error: 'DEBUGPRINT' was not declared in this scope
sketch_feb14a_pde.cpp: In function 'void ht1632_chipfree(byte)':
sketch_feb14a_pde:33: error: 'DEBUGPRINT' was not declared in this scope
sketch_feb14a_pde.cpp: In function 'void ht1632_writebits(byte, byte)':
sketch_feb14a_pde:39: error: 'DEBUGPRINT' was not declared in this scope
sketch_feb14a_pde.cpp: In function 'void ht1632_sendcmd(byte)':
sketch_feb14a_pde:57: error: 'HT1632_ID_CMD' was not declared in this scope
sketch_feb14a_pde.cpp: In function 'void ht1632_senddata(byte, byte)':
sketch_feb14a_pde:66: error: 'HT1632_ID_WR' was not declared in this scope
sketch_feb14a_pde.cpp: In function 'void setup()':
sketch_feb14a_pde:78: error: 'HT1632_CMD_SYSDIS' was not declared in this scope
sketch_feb14a_pde:79: error: 'HT1632_CMD_COMS11' was not declared in this scope
sketch_feb14a_pde:80: error: 'HT1632_CMD_MSTMD' was not declared in this scope
sketch_feb14a_pde:81: error: 'HT1632_CMD_SYSON' was not declared in this scope
sketch_feb14a_pde:82: error: 'HT1632_CMD_LEDON' was not declared in this scope

the line it highlihted is
Code:
  DEBUGPRINT("\nHT1632(%d) ", chipno);

does anyone know what this error is/ how to fix it. im using ide 21 win7 arduino duemilanove.
please help.
thanks
~zac.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 64
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What are you trying to compile?   Based on just the error messages, you are missing binary operator before token "#".....
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6936
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

We need your entire code. What is debugprint function? Which library does it come from?
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using code from
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439/8#8

and using it to code a duelmilanove to run a 8x32 led board.

the code was orriginaly intended to run a 16x24 led board but with some revisions from
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1255052510
it should work with the 8x32.

i get this error when trying to compile. any information would be helpful.
Thanks.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 553
Posts: 46267
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm using code from
Quote
and using it to code a duelmilanove to run a 8x32 led board.
Quote
the code was orriginaly intended to run a 16x24 led board
Quote
but with some revisions...it should work with the 8x32.
So, the code you got from that site is not for the hardware you have. So, you made some changes, won't show us your revised code, and want us to help you figure out what is wrong.

I don't think so.

Post your code if you really want help.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6381
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like you're not #including the "ht1632.h" file, where all those symbols are defined.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh my bad, i will post the code i am using in a moment i need to get on to the other computer to open it. do you want just the .pde? or both the .pde and the .h?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 553
Posts: 46267
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Start with the pde file.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is the code taken for west's post on the old forum
Code:
/*
 * demo16x24.c - Arduino demo program for Holtek HT1632 LED driver chip,
 *            As implemented on the Sure Electronics DE-DP016 display board
 *            (16*24 dot matrix LED module.)
 * Nov, 2008 by Bill Westfield
 */
 
#include "ht1632.h"
 
/*
 * Set these constants to the values of the pins connected to the SureElectronics Module
 */
static const byte ht1632_data = 10;  // Data pin (pin 7)
static const byte ht1632_wrclk = 11; // Write clock pin (pin 5)
static const byte ht1632_cs = 12;    // Chip Select (1, 2, 3, or 4)
                                     // The should also be a common GND.
                                     // The module with all LEDs like draws about 200mA,
                                     //  which makes it PROBABLY powerable via Arduino +5V
/*
 * ht1632_writebits
 * Write bits (up to 8) to h1632 on pins ht1632_data, ht1632_wrclk
 * Chip is assumed to already be chip-selected
 * Bits are shifted out from MSB to LSB, with the first bit sent
 * being (bits & firstbit), shifted till firsbit is zero.
 */
void ht1632_chipselect(byte chipno)
{
  DEBUGPRINT("\nHT1632(%d) ", chipno);
  digitalWrite(chipno, 0);
}
 
void ht1632_chipfree(byte chipno)
{
  DEBUGPRINT(" [done %d]", chipno);
  digitalWrite(chipno, 1);
}
 
void ht1632_writebits (byte bits, byte firstbit)
{
  DEBUGPRINT(" ");
  while (firstbit) {
    DEBUGPRINT((bits&firstbit ? "1" : "0"));
    digitalWrite(ht1632_wrclk, LOW);
    if (bits & firstbit) {
      digitalWrite(ht1632_data, HIGH);
    }
    else {
      digitalWrite(ht1632_data, LOW);
    }
    digitalWrite(ht1632_wrclk, HIGH);
    firstbit >>= 1;
  }
}
 
static void ht1632_sendcmd (byte command)
{
  ht1632_chipselect(ht1632_cs);  // Select chip
  ht1632_writebits(HT1632_ID_CMD, 1<<2);  // send 3 bits of id: COMMMAND
  ht1632_writebits(command, 1<<7);  // send the actual command
  ht1632_writebits(0, 1);      /* one extra dont-care bit in commands. */
  ht1632_chipfree(ht1632_cs); //done
}
 
static void ht1632_senddata (byte address, byte data)
{
  ht1632_chipselect(ht1632_cs);  // Select chip
  ht1632_writebits(HT1632_ID_WR, 1<<2);  // send ID: WRITE to RAM
  ht1632_writebits(address, 1<<6); // Send address
  ht1632_writebits(data, 1<<3); // send 4 bits of data
  ht1632_chipfree(ht1632_cs); // done
}
 
void setup ()  // flow chart from page 17 of datasheet
{
  pinMode(ht1632_cs, OUTPUT);
  digitalWrite(ht1632_cs, HIGH);      /* unselect (active low) */
  pinMode(ht1632_wrclk, OUTPUT);
  pinMode(ht1632_data, OUTPUT);
  ht1632_sendcmd(HT1632_CMD_SYSDIS);  // Disable system
  ht1632_sendcmd(HT1632_CMD_COMS11);  // 16*32, PMOS drivers
  ht1632_sendcmd(HT1632_CMD_MSTMD);   /* Master Mode */
  ht1632_sendcmd(HT1632_CMD_SYSON);   /* System on */
  ht1632_sendcmd(HT1632_CMD_LEDON);   /* LEDs on */
  for (byte i=0; i<128; i++)
    ht1632_senddata(i, 0);  // clear the display!
  delay(1000);
}
 
void loop ()
{
  byte bits;
  byte addr;
  for (addr=0; addr < 96; addr++) {        // Shift in ON bits
    for (bits=8; ; bits=(bits>>1)+8) {
      ht1632_senddata(addr, bits);
      delay(30);
      if (bits == 15) break;
    }
  }
  delay(1000);
  for (addr=0; addr < 96; addr++) {      // Now shift in OFF bits
    for (bits=15; ; bits=(bits>>1)) {
      ht1632_senddata(addr, bits);
      delay(10);
      if (bits == 0) break;
    }
  }
  delay(1000);
}
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 553
Posts: 46267
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I copied and pasted that code in a new sketch, and tried compiling. Got lots of errors. I followed the link to Reply #8 in the thread in the old forum, and copied the contents of the .h file. I created a new tab, and named the file on that tab ht1632.h. I pasted the contents into that file, and selected the Verify button again.

Binary sketch size 1956 of ..., with the board set to Arduino Mega 2560. I got similar results, although a smaller sketch size, with the board set to Duemilanove.

Looks like the problem is how you pasted the .h file contents...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok ill try repasting the .h
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That was the problem. thank you for trouble shooting. i have another question though.  when i verify, then upload it should just run the graphics on the display, correct?  it's receiving power from the computer.  do i need to unplug it from the computer and pug it into my ac/dc adapter?
Edit: i pluged it into the wall. it made no difference.

any suggestions?
« Last Edit: February 16, 2011, 09:53:20 pm by zooloo10 » Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 553
Posts: 46267
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
when i verify, then upload it should just run the graphics on the display, correct?
If everything is wired correctly, I guess it should.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks << no duh!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, i tested the current and its running. i have the wires pluged in the way they should and nothing is happeneing. need help. any suggestions?
Logged

Pages: [1]   Go Up
Jump to: