0
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks << no duh!!
|
 |
« on: February 14, 2011, 09:38:50 pm » |
i got an error thats said 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 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
Faraday Member
Karma: 41
Posts: 5166
CMiYC
|
 |
« Reply #1 on: February 14, 2011, 09:55:56 pm » |
What are you trying to compile? Based on just the error messages, you are missing binary operator before token "#".....
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5918
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #2 on: February 14, 2011, 10:28:59 pm » |
We need your entire code. What is debugprint function? Which library does it come from?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 311
Posts: 35475
Seattle, WA USA
|
 |
« Reply #4 on: February 16, 2011, 04:01:41 am » |
I'm using code from 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...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
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #5 on: February 16, 2011, 05:00:32 am » |
It looks like you're not #including the "ht1632.h" file, where all those symbols are defined.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks << no duh!!
|
 |
« Reply #6 on: February 16, 2011, 06:23:27 pm » |
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
Brattain Member
Karma: 311
Posts: 35475
Seattle, WA USA
|
 |
« Reply #7 on: February 16, 2011, 06:41:18 pm » |
Start with the pde file.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks << no duh!!
|
 |
« Reply #8 on: February 16, 2011, 06:50:56 pm » |
here is the code taken for west's post on the old forum /* * 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
Brattain Member
Karma: 311
Posts: 35475
Seattle, WA USA
|
 |
« Reply #9 on: February 16, 2011, 06:59:57 pm » |
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
Newbie
Karma: 0
Posts: 20
Arduino rocks << no duh!!
|
 |
« Reply #10 on: February 16, 2011, 07:45:24 pm » |
ok ill try repasting the .h
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks << no duh!!
|
 |
« Reply #11 on: February 16, 2011, 09:18:54 pm » |
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
Brattain Member
Karma: 311
Posts: 35475
Seattle, WA USA
|
 |
« Reply #12 on: February 17, 2011, 06:27:32 am » |
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
Newbie
Karma: 0
Posts: 20
Arduino rocks << no duh!!
|
 |
« Reply #13 on: February 17, 2011, 08:36:56 pm » |
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
|
|
|
|
|
|