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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy