Skip to content

Instantly share code, notes, and snippets.

@boombatower
Created November 9, 2015 06:02
Show Gist options
  • Save boombatower/ccdab16926c919eee6b2 to your computer and use it in GitHub Desktop.
Save boombatower/ccdab16926c919eee6b2 to your computer and use it in GitHub Desktop.
Cycle all leds on Logitech g710+ keyboard (demo: https://www.youtube.com/watch?v=XGil25Uhe_o)
<?php
while (true) {
for ($wasd = 0; $wasd < 5; $wasd++) {
for ($other = 0; $other < 5; $other++) {
file_put_contents('/sys/bus/hid/devices/0003:046D:C24D.0002/logitech-g710/led_keys', $wasd << 4 | $other);
usleep(100000);
}
}
for ($i = 0; $i < 16; $i++) {
file_put_contents('/sys/bus/hid/devices/0003:046D:C24D.0002/logitech-g710/led_macro', $i);
usleep(100000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment