We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › i need help about lv maxSonar ez1
Page Index Toggle Pages: 1
i need help about lv maxSonar ez1 (Read 1241 times)
i need help about lv maxSonar ez1
Dec 22nd, 2009, 8:24pm
 

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();
}

Re: i need help about lv maxSonar ez1
Reply #1 - Dec 23rd, 2009, 12:35am
 
What values does your arduino give you and what does processing give you?
Re: i need help about lv maxSonar ez1
Reply #2 - Dec 23rd, 2009, 4:25am
 
in processing only 0.0
in arduino the real values from 10 to 270,  aprox
Re: i need help about lv maxSonar ez1
Reply #3 - Dec 23rd, 2009, 6:58am
 
What did you upload to your arduino?
Re: i need help about lv maxSonar ez1
Reply #4 - Dec 23rd, 2009, 9:21am
 
when it works was with Standar Firmata....
Page Index Toggle Pages: 1