Go Down

Topic: MAking mouse move using Pots (Read 1 time) previous topic - next topic

MilesTone

This might have already been sorted....


Code: [Select]
void draw()
{ serialEvent(myPort);
    fill(225);
    ellipse(valX,valY,20,20);
   if(mousePressed)
  {background(0);
  }
}


You don't need to use mouseX or mouseY at all
just bung the interpreted serial data straight into drawing the ellipse.
MouseX and mouseY just map the position of the cursor within the sketch window.
You would use it the other way round normally, ie. using the mouse data for changing the background color (crap example).

Go Up