Previous in Forum: Code Comedy   Next in Forum: Lines Across Screen
Close
Close
Close
11 comments
Rate Comments: Nested
Member

Join Date: May 2010
Posts: 6

Arduino TLC 5940 16-Bit I need Code Help!

05/17/2010 2:35 AM

I went to www.arduino.cc/playground/learning/TLC5940 and followed thru the instructions and the program had a error message.

D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp: In member function 'void Tlc5940::init()':
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:107: error: 'PB1' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:108: error: 'PB2' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:109: error: 'PD3' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp: In member function 'uint8_t Tlc5940::update()':
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:194: error: 'PB5' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp: In function 'void tlc_shift8_init()':
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:335: error: 'PB3' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:336: error: 'PB5' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:337: error: 'PB2' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp: In member function 'void Tlc5940::init()':
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:107: error: 'PB1' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:108: error: 'PB2' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:109: error: 'PD3' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp: In member function 'uint8_t Tlc5940::update()':
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:194: error: 'PB5' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp: In function 'void tlc_shift8_init()':
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:335: error: 'PB3' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:336: error: 'PB5' was not declared in this scope
D:\arduino\libraries\Tlc5940zzz\Tlc5940.cpp:337: error: 'PB2' was not declared in this scope

can someone help me fix this....please...

Drew

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#1

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/18/2010 5:32 AM

A couple of things that may help though I am not an Arduino expert....

1) The errors appear to be quite consistent and clear that you have not declared many variables correctly (which may or may not clear up all the errors, but they should clear all the "not declared etc" ones). Your compiler manual should help you further to eradicate these errors, so read through with regard to error codes.

2) You have not posted your code that causes the errors (I know it may be big but not all of us studied under the great detective Hercule Poirot!! Also, my Crystal Ball is at the cleaners....!!

3) There are a number of great yahoo blogs for PICs and Arduino chips that you should join and ask your questions of.

4) I also keyed in "Arduino" as a search on Google and got hundreds of hits that should also help you, in several languages too......

5) If you have not followed slavishly the folder names and positions for the compiler libraries, it is also possible that may have something to do with it as well, check your folder structure carefully.

6) Are you using Windows? Which one? That might help an Arduino person here further....

As much information as possible will generally help better than the small amounts you have supplied.

7) If the program you are trying to compile is really big, then pick something tiny to start with, assemble that and if errors are produced, try and find them or ask here again. Start small.....

8) On "Instructables" there are many Arduino projects, start here and search with the name "Arduino" for example:-

http://www.instructables.com/

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Member

Join Date: May 2010
Posts: 6
#10
In reply to #1

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/20/2010 12:44 AM

hmm

Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#11
In reply to #10

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/20/2010 6:11 AM

There have been some tips from Arduino people that looked more than respectable with regard to the errors. Try and follow their guidance......

Arduinos are generally fast chips and have lots of things going for them, (good marketing is also one of them!) but the other chips I mentioned are both very cheap, even in comparison to the Arduino, still fast enough (especially some of the newer ones) for both training/learning as well as many other quite involved jobs, BUT, their single best asset as far as you are concerned is simply NO COMPILING......

So no compiler errors either!! But the PICAXE Basic editor shows you errors when they are in your code often immediately as you key it in (but not always!), so sometimes you know exactly WHERE the error is!!! No searching.....even if it only happens when you run the program the line in error is displayed.....

But having said that, I have still scratched my head a few times about what was wrong.....generally the problems for me was that you try and do something that a PICAXE can do, but not the one you are using at the time!!........done that, been there and got the T-Shirt.....

I certainly am NOT a code expert on ANY chip and I have only read about Arduinos on the web.......but I manage to fumble my way through the bits and pieces I need, one time with online help from PICAXE (Nice folks and very helpful!!). I am NOT a programmer, though I also used to program stuff over 30 years ago.....never been trained is probably what I mean!!

By the way, I have no financial involvement with any of the companies mentioned.....

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Guru

Join Date: Dec 2009
Posts: 581
Good Answers: 15
#2

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/18/2010 10:04 AM

The code definitely seems to want those variables, but dumping a bunch of "unsigned int PB1, PB2..." or whatever into it will likely not produce the desired result. You need to figure out why they are expected but not present. One possibility is a missing #include file.

__________________
Ignorance is no sin. Willful ignorance is unforgiveable.
Register to Reply
Associate

Join Date: Feb 2008
Location: New York
Posts: 54
Good Answers: 2
#3

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/18/2010 5:09 PM

All of those "variables" are actually chip specific macro definitions for pin numbers in IO ports... PB1 is pin 1 in port B, really just 0b00000010 (i think... maybe 0b01000000, but regardless it's just a number)

in laymans terms... you dont need to define any of those things.. you need to

#include <avr/io.h>

but the fact that the arduino environment isn't doing this behind the scenes means something else is broken too.

Reinstall the arduino program first.... then make sure you are telling the IDE the right board you are using...... then try the include above......

Register to Reply
Member

Join Date: May 2010
Posts: 6
#6
In reply to #3

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/19/2010 1:53 AM

it didnt work :( sorry

Register to Reply
Member

Join Date: May 2010
Posts: 6
#4

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/19/2010 1:41 AM

Here is the code I forgot,sorry. :)

BasicAnimations.pde

===============================================================

/* * Writes "Ardunio" with Persistance of Vision (POV) with 16 LEDs * (output 0 is on bottom, output 15 is top). * The animation below doesn't work with more than 1 TLC. * * I generated the animation with the included java code: * <arduino folder>/hardware/libraries/Tlc5940/examples/BasicAnimations * * To use the code, run * java AnimationCreator * in the folder above and it will parse all images in the folder to * .h files. For best results use images that are 16 pixels high. * * See the BasicUse example for hardware setup. * * Alex Leone <acleone ~AT~ gmail.com>, 2008-11-12 */#include "tlc_config.h"#include "Tlc5940.h"#include "tlc_animations.h"#include "ani_arduino.h"void setup(){ Tlc.init();}void loop(){ if (!tlc_onUpdateFinished) { /* delay so the animation isn't playing constantly */ delay(100); /* void tlc_playAnimation( * prog_uint8_t *animation, * uint16_t frames, * uint16_t periodsPerFrame); * periods per frame is PWM periods (~1ms) per frame * (0 is valid - this will play the animation as fast as possible). * * Plays an animation in the "background". * Don't call Tlc.update() while this is running. * You can check if this is done with !tlc_onUpdateFinished */ tlc_playAnimation(ani_arduino, ANI_ARDUINO_FRAMES, 3); /* * If you don't want to do anything until it's finished, use */ // while (!tlc_onUpdateFinished); /* and get rid of the if(!tlc_onUpdateFinished) above */ }

}

=============================================================

ani_arduino.h

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#define ANI_ARDUINO_FRAMES 80uint8_t ani_arduino[NUM_TLCS * 24 * ANI_ARDUINO_FRAMES] PROGMEM = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,6,176,206, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,65,10,64,247,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,1,160,122,13,192,255,15,240,254,11,192,89, 0,0,0,0,0,0,0,0,4,4,240,179,15,192,255,15,240,255,8,32,33,0,0,0, 0,0,0,0,0,37,8,128,231,15,240,255,15,144,169,15,240,255,0,0,0,0,0,0, 0,0,94,12,16,255,15,240,255,13,64,113,1,48,0,15,240,255,0,0,0,0,0,0, 0,0,255,15,240,243,9,192,56,0,0,0,0,0,0,15,240,255,0,0,0,0,0,0, 0,0,255,15,240,243,9,208,57,0,0,0,0,0,0,15,240,255,0,0,0,0,0,0, 0,0,93,12,0,255,15,240,255,13,80,114,1,64,0,15,240,255,0,0,0,0,0,0, 0,0,0,0,0,36,8,112,230,15,240,255,15,144,170,15,240,255,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,4,4,224,178,15,192,255,15,240,255,8,32,32,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,1,144,121,13,176,255,15,240,254,11,160,86, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,10,48,246,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,6,160,206, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,2,9,224,248,7,32,24,0,16,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,109,15,240,115,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,208,15,240,25,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,248,15,240,1,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,253,15,240,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,16,90,11,176,237,15,192,237,11,176,90,0,16,0, 0,0,0,0,0,0,0,0,6,11,0,255,15,240,255,15,240,255,15,240,255,11,16,6, 0,0,0,0,0,0,0,0,125,15,240,247,7,48,26,0,48,26,7,16,246,15,240,126, 0,0,0,0,0,0,0,0,221,15,240,100,0,0,0,0,0,0,0,0,98,15,240,222, 0,0,0,0,0,0,0,0,250,15,240,14,0,0,0,0,0,0,0,0,13,15,240,249, 0,0,0,0,0,0,0,0,226,15,240,14,0,0,0,0,0,0,0,0,13,15,240,223, 0,0,0,0,0,0,0,0,130,15,240,103,0,0,0,0,0,0,0,0,100,15,240,131, 0,0,0,0,0,0,0,0,5,10,112,248,7,96,27,0,64,27,7,64,247,10,112,6, 15,240,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 15,240,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,253,14,144,173,3,32,0, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,144,57, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,224,201,15,240,186, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,15,240,242, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,15,240,246, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,15,240,206, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,15,240,102, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,6,32,246,9,80,0, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 15,240,255,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 15,240,255,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,255,15,240,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,0,9,64,246,6,48,13,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,100,15,240,111,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,208,15,240,24,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,250,15,240,4,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,241,15,240,47,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,186,15,240,202,2,240,3,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,57,15,144,255,15,240,255,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,0,3,32,173,14,144,253,15,240,255,15,240,255,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,73,11,80,235,15,176,235,11,80,74,0,0,0, 0,0,0,0,0,0,0,0,0,8,80,255,15,240,255,15,240,255,15,240,255,8,144,0, 0,0,0,0,0,0,0,0,72,15,240,254,8,128,31,0,64,31,8,128,254,15,240,74, 0,0,0,0,0,0,0,0,179,15,240,137,0,0,0,0,0,0,0,0,136,15,240,181, 0,0,0,0,0,0,0,0,234,15,240,32,0,0,0,0,0,0,0,0,31,15,240,235, 0,0,0,0,0,0,0,0,251,15,240,5,0,0,0,0,0,0,0,0,4,15,240,251, 0,0,0,0,0,0,0,0,234,15,240,33,0,0,0,0,0,0,0,0,32,15,240,235, 0,0,0,0,0,0,0,0,179,15,240,142,0,0,0,0,0,0,0,0,138,15,240,180, 0,0,0,0,0,0,0,0,69,15,240,255,8,224,33,0,80,32,8,176,254,15,240,72, 0,0,0,0,0,0,0,0,0,8,16,255,15,240,255,15,240,255,15,240,255,8,80,0, 0,0,0,0,0,0,0,0,0,0,0,70,11,48,234,15,176,234,11,48,72,0,0,0,

};

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TLC5940.h

---------------------------------------------------------------------------

/* * Copyright (c) 2008 by Alex Leone <acleone ~AT~ gmail.com> * Last Edited: 2008-11-11 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */#ifndef TLC5940_H#define TLC5940_H/** * \file * Tlc5940 library header file. */#include <stdint.h>/** Enables the Timer1 Overflow interrupt, which will fire after an XLAT pulse */#define set_XLAT_interrupt() TIFR1 |= _BV(TOV1); TIMSK1 = _BV(TOIE1)/** Disables any Timer1 interrupts */#define clear_XLAT_interrupt() TIMSK1 = 0/** Enables the output of XLAT pulses */#define enable_XLAT_pulses() TCCR1A = _BV(COM1A1) | _BV(COM1B1)/** Disables the output of XLAT pulses */#define disable_XLAT_pulses() TCCR1A = _BV(COM1B1)extern volatile uint8_t tlc_needXLAT;extern volatile void (*tlc_onUpdateFinished)(void);extern uint8_t tlc_GSData[NUM_TLCS * 24];/** * The main Tlc5940 class for the entire library. An instance of this class * will be preinstantiated as Tlc */class Tlc5940{ public: void init(void); void clear(void); uint8_t update(void); void set(TLC_CHANNEL_TYPE channel, uint16_t value); uint16_t get(TLC_CHANNEL_TYPE channel);#if VPRG_ENABLED void setAllDC(uint8_t value);#endif#if XERR_ENABLED uint8_t readXERR(void);#endif};void tlc_shift8_init(void);void tlc_shift8(uint8_t byte);#if VPRG_ENABLEDvoid tlc_dcModeStart(void);void tlc_dcModeStop(void);#endif// for the preinstantiated Tlc variable.extern Tlc5940 Tlc;

#endif

--------------------------------------------------------------------------------

I also got this file from Alex. but doesnt work either.

********************************************************

#if !defined(PB1)
#define PB1 PORTB1
#endif

void setup()
{
DDRB &= ~_BV(PB1);
}

void loop()
{
PORTB ^= _BV(PB1);

}

*************************************************************

The Second test to see if it fixed it didnt work either.

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

#define PB1 PORTB1

void setup()

{

DDRB &= ~_BV(PORTB1);

}

void loop()

{

PORTB ^= _BV(PORTB1);

}

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

If anyone can run this code and it works let me know please and what OS your runing and how your compiling it. I use windows 7 Ultimate with 018 Arduino software.

I have ran other programs like "Blink" and works fine. so I know the uploading is working. I have all the updates for Java software. I did the updates still no dice? so will this work on linux? maybe it doesn't like windows? I wish this would work. :( Thanks for everyone's help so far with this issue. I have see or website's state the same issue,I just want a working LED fader for my Arduino Duemilanove. Any idea's?

DRewwwwwwwwww

Register to Reply
Member

Join Date: May 2010
Posts: 6
#5

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/19/2010 1:52 AM

ok,I did what he said to do and add the file.

/* * Writes "Ardunio" with Persistance of Vision (POV) with 16 LEDs * (output 0 is on bottom, output 15 is top). * The animation below doesn't work with more than 1 TLC. * * I generated the animation with the included java code: * <arduino folder>/hardware/libraries/Tlc5940/examples/BasicAnimations * * To use the code, run * java AnimationCreator * in the folder above and it will parse all images in the folder to * .h files. For best results use images that are 16 pixels high. * * See the BasicUse example for hardware setup. * * Alex Leone <acleone ~AT~ gmail.com>, 2008-11-12 */

#include "avr/io.h"

#include "tlc_config.h"

#include "Tlc5940.h"

#include "tlc_animations.h"

#include "ani_arduino.h"

void setup()

{

Tlc.init();

}

*******************************

I cut the rest of the program out save space on this thread. Here is the OUTPUT I got once i verify it.

******************************************************

D:\arduino\libraries\Tlc5940\/Tlc5940.h:86:2: error: #endif without #if

*****************************************************

I'm no programmer so I dont know how to fix this.

Drew

Register to Reply
Guru

Join Date: Dec 2009
Posts: 581
Good Answers: 15
#8
In reply to #5

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/19/2010 9:39 AM

If your TLC5940.h file actually looks like it does in your post (all crammed together with no line breaks), then that's your problem. You need an un-crammed version because the C pre-processor (which also runs in a C++ project [more or less, I think some C++ implementations use a pre-processor with slightly different rules]) cares about end-of-lines, though the C/C++ compiler doesn't.

Assuming it's just the CR4 editor doing it to the code, I loaded it in an editor and tried to parse it out. That can get tricky, but any self-proclaimed C guru should be able to manage it. I didn't see any problems with #if and #endif. Frequently, this error is caused upstream of the message. So look at tlc_config.h and make sure there's exactly one #endif for every #if (or #ifdef, #ifndef, etc.). If that one checks out, look at avr/io.h.

Or, you can follow AG's advice and start with a Basic environment.

__________________
Ignorance is no sin. Willful ignorance is unforgiveable.
Register to Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#7

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/19/2010 4:41 AM

It sounds like you are a beginner (no harm in that, we all have to start somewhere!), but maybe the Arduino chip is just a tad too complicated for you at this time (this could be a week or even a month too soon. Or even just a day or two!).

As you do not appear to have a local mentor, may I suggest that you either make a start with the PICAXE or the KiChips, sort of walking before you run.....

Look here:-

http://www.rev-ed.co.uk/picaxe/

or here:-

http://www.kicchip.co.uk/

They are compatible to each other, provide a "built-in" Basic interpreter (no need to compile till you learn far more), are fully software compatible to each other and are also probably the absolute cheapest way to get into PIC programming.

The program loading does not even require a programmer as the chips have a built in serial interface and can be eother downloaded from a laptop/PC with a serial port, or buy the Rev-Ed USB to Serial cable (one of the best and most compatible ones around, other ones may not work as they are maybe not 100% compatible to serial data) if you have no serial ports.....

Basic is a language that can be used in a simple way for beginners (I started with basic over 30 years ago at home with my first home computer, a Nascom 2), but can also produce very professional things too. Basically its as complicated, or as easy as you want to make it.....and no compiling!!!

Arduino is a (more expensive too!) version that you can come back to once you have learned a lot more......

A lot of the hardware is still compatible between all three if you are careful.....so all is not lost.

All the software that you need is free to download from Rev-Ed and it can also be run/tested, without even owning a chip, so you cn see how your basic program will (or won't!) run before investing even 1 cent!!!

I speak as though I am a PICAXE expert, I am most certainly not, but I enjoy playing around with these wonderful chips.....and things work, maybe not always the first (or second !!) time, but they do seem to end up working. Good for the soul!!!

There is also a PICAXE Blog on Yahoo with lots of help and ideas.....and many many firms all over the world sell the products.....cheaply.

Best of luck.....

__________________
"What others say about you reveals more about them, than it does you." Anon.
Register to Reply
Member

Join Date: May 2010
Posts: 6
#9
In reply to #7

Re: Arduino TLC 5940 16-Bit I need Code Help!

05/19/2010 6:14 PM

Andy Germany,

your a life saver !! I downloaded the program and going to check it out. PIC axe is one of those chips i was gonna get and try out but Arduino is more powerful for the things I would like to get done. Thank you for giving me more INPUT #5 !

I was watching Short circuit last night. Anyways can you try to see if that program works or not? when I posted it the code got all put together. Each line was on it's own.

I got 5 TLC4950 chips sitting here on my desk and I got 5 TPIC6A596NE

I have a clue about Electronics just not programming. The Last computer(s) I programmed was a IBM model 4/25mhz and Atari 800XL/800 and TI-99 Trash80 model 1, 2, 3, 4 back in 1978.

Been doing ALL types of Electronics from one-end-to-next. My only thing I havent worked on was micro-controllers. so here I am starting. My first is an Arduino 328P-PU

Register to Reply
Register to Reply 11 comments
Copy to Clipboard

Users who posted comments:

Andy Germany (3); Dead Bear (1); drewmaster74 (5); Lynn.Wallace (2)

Previous in Forum: Code Comedy   Next in Forum: Lines Across Screen
You might be interested in: Error Correction Chips, Bit Error Rate Testers

Advertisement