-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjiggle-wiggle.ino
52 lines (45 loc) · 1.18 KB
/
jiggle-wiggle.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
////////////////////////////////////////////////////////////////////////////////
// Jiggle-Wiggle https://bela.me
////////////////////////////////////////////////////////////////////////////////
#include <Mouse.h> // generic mouse hid
#include <Adafruit_NeoPixel.h> // ws2812 leds
#define LED_NEO_PIN 16
#undef LED_RED_PIN
#undef LED_GRN_PIN
#undef LED_BLU_PIN
Adafruit_NeoPixel ioLed(1, LED_NEO_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
Mouse.begin();
ioLed.begin();
ioLed.clear();
ioLed.show();
ioLed.setBrightness(16);
}
void loop() {
delay(5000);
while(true) {
jiggle();
wiggle();
delay(15000);
}
}
// move the mouse cursor
void jiggle() {
Mouse.move(2,0,0);
ioLed.setPixelColor(0, ioLed.Color(255, 0, 0));
ioLed.show();
delay(100);
Mouse.move(-4,0,0);
ioLed.setPixelColor(0, ioLed.Color(0, 255, 0));
ioLed.show();
delay(100);
Mouse.move(2,0,0);
ioLed.setPixelColor(0, ioLed.Color(0, 0, 255));
ioLed.show();
delay(100);
ioLed.setPixelColor(0, ioLed.Color(0, 0, 0));
ioLed.show();
}
// display brief led animation
void wiggle() {
}