diff --git a/src/main.cpp b/src/main.cpp index 9e01a58..b0b96db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,32 +1,37 @@ #include #include #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); }