TLC5940 and Processing

I am having trouble getting servos attached to a TLC5940 to respond to serial input from Processing (Simple Write sketch).
I have tried setting a variable as int or char, and I can see the Tx light going off on the Arduino board, but no movement.
The servo will respond to tlc_setServo command without serial input. Thanks in advance for any advice.

[arduino code]
#include “Tlc5940.h”
#include “tlc_servos.h”

int numberOfServos = 1; //how many servos on the chain?

void setup(){
tlc_initServos(); // Note: this will drop the PWM freqency down to 50Hz.

void loop(){
while (Serial.available() >0) {

int v =;
tlc_setServo(1, v);
[/arduino code]

[Processing code]
import processing.serial.*;

Serial myPort; // Create object from Serial class
int val; // Data received from the serial port

void setup()
size(200, 200);
String portName = Serial.list()[3];
myPort = new Serial(this, portName, 9600);

void draw() {
if (mouseOverRect() == true) { // If mouse is over square,
fill(204); // change color and
println(‘H’); // send an H to indicate mouse is over square
rect(50, 50, 100, 100); // Draw a square

boolean mouseOverRect() { // Test if mouse is over square
return ((mouseX >= 50) && (mouseX <= 150) && (mouseY >= 50) && (mouseY <= 150));
[/Processing code] gets a single character. It looks like you're expecting it to read the string you send and set v to 15 - it won't. I'd suggest you test the arduino piece stand alone by using the serial monitor and typing manually what the processing sketch is supposed to send. Then you can use the serial.print commands to see what v actually gets set to. Once you see what's going on, you'll need to accumulate the characters you get into an array, null terminate it and then use atoi to get the value you're looking for.

Thanks so much - I tried this and it worked for me.