i am trying to use an ultrasound sensor HC-SR04 with arduino and pure data now while i am getting the distance in the serial monitor of arduino but i can't get this distance in Pure data
I am using Serial.write to get the nos to pd but without much success
the pd patch i am using is the one we use for digital input except that instead of routing the echo pin to a toggle i am routing it to a number box
but i am getting no nos in the number box
THE arduino patch i am using is-
#define trigPin 13
#define echoPin 12
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
}

void loop() {
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(2);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
Serial.print(distance);
Serial.println(" cm");
Serial.write(distance);
delay(500);

now I am getting the distance in the serial monitor.
but when I am opening the pure data I dont get anything
in pure data my patch is
pinMode 12 input
arduino
route digital
route 12
number
but getting no value in the number box
please help