lv maxSonar ez1

I have an arduino duemilanove, an lv-maxsonar ez1 and u have de codes in processing to make some changes in a video, the thing is that in arduino de sensor works, but arduino and processing doesn´t read de same values from the device. I will write the code to see if someone could help me!!!!

import processing.serial.; import cc.arduino.; import processing.video.*;

Movie myMovie;

Arduino arduino; float myValue; float smoothValue; float smoothness;

void setup(){ size(320, 240, P2D); println(Arduino.list()); arduino = new Arduino(this, Arduino.list()[0], 19200); smoothness = .4;

myMovie = new Movie(this, "examen.mov"); myMovie.loop(); }

void draw(){ myValue = arduino.analogRead(3); println(myValue); float dValue = (myValue-smoothValue)*smoothness; smoothValue+=dValue; float mapValue = map(smoothValue,40,300,255,0); background(mapValue); tint(255, mapValue); image(myMovie, 0, 0, 320, 240); }

void movieEvent(Movie myMovie) { myMovie.read(); }