Processing Serial Port Issue

Dear All,

I am sending data from a Analog LDR sensor (Lilypad) from the Arduino Environment (1.0.5) to Processing (2.0b9). An what usually never was an issue suddenly is very strange:

I am sending using this command (baud rate is 9600 for both):

sensorValue = analogRead(sensorPin);

Here it's all fine, when I have a LED fading according to this, it's working fine.

Then receiving (Processing) this commands:

while (port.available() > 0) {

    int inBuffer =;


What i get is a row of numbers: 51 96 0 134 30 195 30 51 128 152 128 6

How can I translate this into the 0-255 scale that I need from the LDR?

Best, PJ

ok, i got it done, by using the serialEvent function:

void serialEvent (Serial myPort) {

String inString = myPort.readStringUntil('\n');
inString = trim(inString);
newInt = float(inString); 
newInt = float(inString);

WTF? Why do you have a float called newInt? Do you also have an int called newFloat somewhere?