Ok, you want to send data to your computer from your code running on your arduino and you don't want to design a protocol? Use #Firmata!!
It's easy and fun!
In the top of yor file don't forget to
#include <Firmata.h>
In your setup:
//start serial connection
Firmata.setFirmwareVersion(FIRMATA_FIRMWARE_MAJOR_VERSION, FIRMATA_FIRMWARE_MINOR_VERSION);
Firmata.begin(57600);
In your loop:
// Send any analogue data whenever *you* feel like it without having to set anything in the client code!
Firmata.sendAnalog(SENSOR_PIN, analogRead(SENSOR_PIN));
And, when you want to send something weird, like the results from your proximity sensor, you can roll your own sysex:
Firmata.write(START_SYSEX);
Firmata.write(SONAR_DATA);
Firmata.sendValueAsTwo7bitBytes(distance); //writes value as 2 bytes
Firmata.write(END_SYSEX);
Then, when you want to receive all of this stuff in PD, you treat the analog stuff as normal.
For the sysex, let's assume SONAR_DATA is 99:
[arduino 1]
[route analog 99]
The first outlet goes to do your analog stuff.
The second outlet outputs the two byte long distance that you measured with your sonar.
Need extra sonar modules? Increment the IDs!