Pages: 1 [2]   Go Down
Author Topic: MAking mouse move using Pots  (Read 914 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This might have already been sorted....


Code:
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).
Logged

Pages: 1 [2]   Go Up
Jump to: