Created
June 19, 2013 19:46
-
-
Save RonjaPonja/5817418 to your computer and use it in GitHub Desktop.
new ardu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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);
}