get distance with ez0 sensor + arduino + processing

HI, I'm trying to figure out how to code in processing to read values from my distance sensor Maxbotix LV EZ-0 and EZ-4 and have the values change an image on the screen. I am running a simple program to display sensor values from each of the two sonars in arduino but i cann't found the appropriate code in Processing. // Arduino code for reading sensor values from Maxbotix LV EZ-0 and EZ4 Sensors int pwEZ0 = 8; int pwEZ4 = 7;

long pulseEZ0, cmEZ0 ; long pulseEZ4, cmEZ4 ;

void setup() { Serial.begin(9600); }

void loop() { pinMode(pwEZ0, INPUT);

pulseEZ0 = pulseIn(pwEZ0, HIGH); cmEZ0 =pulseEZ0/147;



pinMode(pwEZ4, INPUT);

pulseEZ4 = pulseIn(pwEZ4, HIGH); cmEZ4= pulseEZ4/147;


delay(500); }

Any help is much appreciated. Thanks!