-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
variables instead of nonsense numbers!
- Loading branch information
Showing
1 changed file
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
#include <Arduino.h> | ||
#include <BleMouse.h> | ||
#define MINUTE 60000 | ||
#define X_RANDOM_RANGE 3 | ||
#define Y_RANDOM_RANGE 3 | ||
|
||
BleMouse bleMouse("DroChill Mouse Jiggler v1"); | ||
|
||
BleMouse bleMouse("DroChill mouse jiggler v1"); | ||
|
||
int move_interval = 12; // with lower interval notify(): << esp_ble_gatts_send_ notify: rc=-1 Unknown ESP_ERR error appears | ||
int loop_interval = MINUTE * 1; | ||
uint16_t min_distance, max_distance; | ||
|
||
void setup() | ||
{ | ||
bleMouse.begin(); | ||
min_distance = 30; | ||
max_distance = 600; | ||
bleMouse.begin(); | ||
} | ||
|
||
void loop() | ||
{ | ||
|
||
int distance = random(10, 600); | ||
int x = random(3) - 1; | ||
int y = random(3) - 1; | ||
for (int i = 0; i < distance; i++) { | ||
|
||
int distance = random(min_distance, max_distance); | ||
int x = random(X_RANDOM_RANGE) - 1; | ||
int y = random(Y_RANDOM_RANGE) - 1; | ||
|
||
for (int i = 0; i < distance; i++) | ||
{ | ||
bleMouse.move(x, y, 0); | ||
delay(move_interval); | ||
|
||
} | ||
if (random(0,7) == 3 ) | ||
bleMouse.click(MOUSE_RIGHT); | ||
|
||
if (random(0, 7) == 3) | ||
bleMouse.click(MOUSE_RIGHT); | ||
|
||
delay(loop_interval); | ||
} |