Go Down

Topic: Arduino Uno Inconsistent and Flickering with TLC5940 (Read 4 times) previous topic - next topic

abocanegra

**** UPDATE *****
So reworking the arduino code to utilize C++ chars rather than strings seems to have solved the problem with it acting inconsistently. The flicker that remained ended up a simple fix. I shortened the length of the wires connecting the buffers as much as physically possible (approximately an inch). I am still unsure why it only was a problem with the Uno and not the Duemilanove. Regardless, it works perfectly on both now. I am attaching a photo of the 1st panel running on the Raspberry Pi with an Uno (Left) and a Duemilanove (Right). All addresses work perfectly and no flicker.



Thanks for all of your help. After this project is over, I'll scour the forum to see if there is anything I can help out with.

GoForSmoke


**** UPDATE *****
So reworking the arduino code to utilize C++ chars rather than strings


Could you please be more clear for all of us what you mean by

A) C++ chars

B) strings

I'm a bit confused and 2 members have quoted this post to apparently mean opposite things.

My big clue is that you used the term "reworked" as you did.
I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

abocanegra

I am referring to the above advice that the strings in Arduino cause memory issues. Which is what i used in my initial code posting. The reworked code removes all use of Arduino strings in favor of the more reliable (and faster) C++ chars to build the calls from the Serial.read() and trigger the Tlc commands. I posted the reworked code as well.

Hope this helps

GoForSmoke


I am referring to the above advice that the strings in Arduino cause memory issues. Which is what i used in my initial code posting. The reworked code removes all use of Arduino strings in favor of the more reliable (and faster) C++ chars to build the calls from the Serial.read() and trigger the Tlc commands. I posted the reworked code as well.

Hope this helps


That's nice except your terms are mixed up which is okay for you since what you do works but is confusing for others.

There is no Arduino strings except as C strings or C++ String objects. Arduino uses C/C++ and that maybe causes confusion among new people.

C strings are kept in char arrays as ASCII text code and always end with a NULL (zero) char.

C++ Strings are declared as capital S String and keep their ASCII text inside.

If/when you get into C++ and learn Classes, String is one of those.
I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Nick Gammon

He is clearly referring to the Arduino IDE-supplied String class:

http://arduino.cc/en/Reference/StringObject

The original post uses String, which I advised against.

Unfortunately the word "string" has quite a few meanings (apart from the stuff you tie up your roast with, and the ones related to theoretical physics).

Character arrays are often referred to as strings, even though the word "string" does not appear. Then there is the Arduino String class, and no doubt lots of other people have their own String classes. Then there is the STL string class (note the lower-case s).

Go Up