Skip to content

Instantly share code, notes, and snippets.

@HerrSpace
Created June 19, 2013 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HerrSpace/5817418 to your computer and use it in GitHub Desktop.
Save HerrSpace/5817418 to your computer and use it in GitHub Desktop.
new ardu
void setup() {
Mouse.begin();
int count = 0;
}
void loop() {
count++:
int x = sin(count) * 200;
int y = asin(count) * 200;
Mouse.move(x, y, 0);
}
@BBBSnowball
Copy link

include <util/delay.h>

int count = 0;

void setup() {
Mouse.begin();
srand(0);
}

void loop() {
count++;
int x = sin(count/10) * 10;
int y = cos(count/10) * 10 + (int)(rand()*2-1);

Mouse.move(x, y, 0);

_delay_ms(10);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment