Now with Arduino version
This commit is contained in:
parent
79d9bfe23f
commit
515d65f252
|
@ -0,0 +1,29 @@
|
||||||
|
#include <DigiMouse.h>
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
DigiMouse.begin(); //start or reenumerate USB - BREAKING CHANGE from old versions that didn't require this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int step = 0;
|
||||||
|
double stepsize = PI / 100;
|
||||||
|
int oldx = 0;
|
||||||
|
int oldy = 0;
|
||||||
|
int rad = 100;
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
int x = (cos(stepsize * step) * rad);
|
||||||
|
int y = (sin(stepsize * step) * rad);
|
||||||
|
|
||||||
|
DigiMouse.moveY(y - oldy);
|
||||||
|
DigiMouse.moveX(x - oldx);
|
||||||
|
DigiMouse.update();
|
||||||
|
|
||||||
|
oldx = x;
|
||||||
|
oldy = y;
|
||||||
|
|
||||||
|
step ++;
|
||||||
|
if (step == 201)//less operations than modulo and we need that calculation power!
|
||||||
|
step = 0;
|
||||||
|
delay(5);
|
||||||
|
}
|
|
@ -1,8 +1,11 @@
|
||||||
# MouseTroll
|
# MouseTroll
|
||||||
A little Programm, that spinn your mouse coursor.
|
A little Programm, that spinn your mouse coursor.
|
||||||
There is an Arduino Digispark version for [this](http://digistump.com/products/1) USB-Stick planed.
|
The Arduino version is for [this](http://digistump.com/products/1) USB-Stick.
|
||||||
|
|
||||||
To stop the Java version, just move your mouse to the top left corner and then down to the bottom right within 5 seconds
|
To stop the Java version, just move your mouse to the top left corner and then down to the bottom right within 5 seconds
|
||||||
(should work for multi-screen-setup, but no warranty.)
|
(should work for multi-screen-setup, but no warranty.)
|
||||||
|
To stop the Arduino version just unplug the device or constantly reset the processor of the device (not the computer!!!).
|
||||||
|
|
||||||
###### Have a nice, funny troll
|
###### Have a nice and funny troll
|
||||||
|
|
||||||
|
I take no warranty for anything!
|
Loading…
Reference in New Issue