Processing Help


Got a question about Processing? Create a new topic and add it to this category!


I moved 2 posts to a new topic: Processing Question


Hey Im trying to play a sound clip in processing whenever a motion detector on my arduino detects motion. My idea is to use the serial port info to detect a value, and in processing use any value greater than 0 to have the sound play once. As of right now the sound plays at the start and never again.


boolean motion = 0;

void setup() {
pinMode(8, OUTPUT);
pinMode(7, INPUT);
pinMode(2, OUTPUT);

void setup(){
void loop() {
motion = digitalRead(7);
if(motion == 1){
digitalWrite(8, HIGH);

digitalWrite(8, LOW);



import processing.serial.;
import ddf.minim.

Serial myPort;

String val;

Minim minim;
AudioPlayer song;

void setup() {
String portName = Serial.list()[1];
myPort= new Serial(this, portName, 9600);
minim = new Minim(this);
song = minim.loadFile(“Sound1.wav”, 1024);


void draw(){

if ( myPort.available() > 0) {
// If data is available,
//val = myPort.readStringUntil(’\n’);;