Sketch not compiling or uploading

hello there I am wondering if someone can help me with a sketch issue im having.
I was previuosly using verion 1.04 of the software and used the following sketch to activate a tlc5940 chip. All was working fine but now but I cant get it to work on version 1.06.
Im sending generic serial data to the arduino to control the tlc and some high current mosfets.

here is the code

<void setup()
/*
The purpose of this code is to allow the Arduino to use the
generic serial output of vixen lights and the TLC library
at Google Code Archive - Long-term storage for Google Code Project Hosting.
to control many channels of LEDs.
Author: Matthew Strange
Created: 29 October 2010
*/

#include "Tlc5940.h"
{
/* Call Tlc.init() to setup the tlc.
You can optionally pass an initial PWM value (0 - 4095) for all channels.*/
Tlc.init();
Serial.begin(19200);
}

/* Set the channel number using the vixen variable in the tlc_config.h file */

void loop()
{
Tlc.clear();
if (Serial.available() > VIXEN+2) {
int uno = Serial.read();
if (uno == 126){
int dos = Serial.read();
if (dos == 33){
for (int i=0; i<VIXEN+1; i++) {
int bb = Serial.read();
if (bb > 0){
bb = (((bb+1) * 16) - 1);
}
Tlc.set(i, bb);
bb = 0;
}
Tlc.update();
}
}
}
}

this code was written by another user. sorry if im posting in the wrong place.

Many thanks

matt

I cant get it to work on version 1.06.

What error messages do you get when you try to compile it ?

The structure of the program looks very strange. Why is the #include between the name of the setup() function and the contents of the setup() function ?

Where is the "Tlc5940.h" file on your PC ?

So when you have got rid of the stupid #include inside the setup function and moved it outside you are left with:-

The comment says:-

/* Set the channel number using the vixen variable in the tlc_config.h file */

BUT
the tlc_config.h does not have the word VIXEN in it.

That code as you posted it never ever compiled.

Oh I have just got a newer computer that I'm using and haven't copied over the original config files for the library.
Quote silly mistake on my behalf.

Thanks for the grilling.

I will change as suggested and get back to you.

Kindest regards

Matt

#include "Tlc5940.h"
{
  /* Call Tlc.init() to setup the tlc.
     You can optionally pass an initial PWM value (0 - 4095) for all channels.*/
  Tlc.init();
  Serial.begin(19200);
}

You seem to be missing something here. It's like you pasted the include statement over the setup() function declaration.

hello again
I have managed to get it to work wth 1 chip connected to the arduino.
But no outputs further than 16.

i have defined the num of tlc chips in the config.h file as necessary.

here is the code again, it compiles and uploads fine.

could it be to do with the sketch itself, is there something i need to add to this?

thanks for all the help.

matt

/* TLC5940 Vixen controller
*/
#include "Tlc5940.h"

void setup()
/*
the purpose
*/
{
  Tlc.init();
  Serial.begin(9600);
}

void loop()
{
  Tlc.clear();
  if (Serial.available() > VIXEN+2) {
    int uno = Serial.read();
    if (uno == 126){
      int dos = Serial.read();
      if (dos == 33){
        for (int i=0; i<VIXEN+1; i++) {
          int bb = Serial.read();
          if (bb > 0){
            bb = (((bb+1) * 32) - 1);
          }
          Tlc.set(i, bb);
          bb = 0;
        }
        Tlc.update();
      }
    }
  }
}

Please edit your post, select the code, and put it between [code] ... [/code] tags.

You can do that by hitting the "Code" button above the posting area (It looks like a scroll with < > inside it).

How to use this forum

Where is VIXEN defined? I can't see it. Please post a link to the exact library you are using. The Google page has a number of downloads on it.

https://code.google.com/p/tlc5940arduino/downloads/detail?name=Tlc5940_r014_2.zip

Hi there. I have included the link above.

I add the following to the config file

#define NUM_TLCS 1
#define VIXEN 16

hope this makes sense.

kind regards

matt

Good evening.

Just wanted to let you know I have solved my problem with the sketch.

I hadn't updated the configuration file properly. I now have all 4 of the TLC chips working nicely.

Thanks ever so much for your input and thoughts.

Kindest regards

Matt