Hello. We have this example-code but our first problem with it is that it starts to play a sound right away and does not stop until this error messages comes up: "Invalid memory access of location". the mp3 never stops playing

// I know that the first port in the serial list on my mac // is always my Keyspan adaptor, so I open Serial.list()[0]. // Open whatever port is the one you're using. myPort = new Serial(this, Serial.list()[0], 9600); myPort.buffer(3);

I am totally new at this and dont really have every part of the code fully understood. I understand that inString needs a new value to stop the song from playing but i have no idea what to write. I have been searching for rewind() in the minim-library but cant really get it working.

the data for inString comes from Arduino. the float receives its value from a range sensor.

You need to receive numbers into your Processing, s write a very simple looping app on the Arduino that outputs an incrementing count, at a rate of one complete number every two seconds.Verify that this works using the Serial Monitor.When you've done that, use it to debug your Processing.

When you've debugged your Processing, and are reliably accepting and processing numbers, go back to your Arduino code, and concentrate on getting the rangefinder working, again using the Serial Monitor.

Build on proven software and simple steps - chucking it all together and expecting it to work is a bit ambitious.

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.Do not send technical questions via personal messaging - they will be ignored.