Skip to content

Instantly share code, notes, and snippets.

View shaileshaanand's full-sized avatar
🎯
Focusing

Shailesh Aanand shaileshaanand

🎯
Focusing
View GitHub Profile
@shaileshaanand
shaileshaanand / printer.cfg
Created November 17, 2023 18:18
printer.cfg
[gcode_macro Frame_Light_ON]
gcode:
RUN_SHELL_COMMAND CMD=framelighton
[gcode_macro Frame_Light_OFF]
gcode:
RUN_SHELL_COMMAND CMD=framelightoff
@shaileshaanand
shaileshaanand / printer.cfg
Created November 17, 2023 18:17
printer.cfg
[gcode_shell_command framelighton]
command: sh /home/mks/framelighton.sh
timeout: 30.
verbose: True
[gcode_shell_command framelightoff]
command: sh /home/mks/framelightoff.sh
timeout: 30.
verbose: True
[gcode_shell_command partlighton]
command: sh /home/mks/partlighton.sh
@shaileshaanand
shaileshaanand / partlightoff.sh
Created November 17, 2023 18:16
partlightoff.sh
#!/bin/sh
echo 0 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio79/value
@shaileshaanand
shaileshaanand / partlighton.sh
Created November 17, 2023 18:15
partlighton.sh
#!/bin/sh
echo 1 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio79/value
@shaileshaanand
shaileshaanand / framelightoff.sh
Created November 17, 2023 18:14
framelightoff.sh
#!/bin/sh
echo 0 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio66/value
@shaileshaanand
shaileshaanand / framelighton.sh
Created November 17, 2023 18:13
framelighton.sh
#!/bin/sh
echo 1 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio66/value
@shaileshaanand
shaileshaanand / rc.local
Created November 17, 2023 18:11
Start Script
echo 79 > /sys/class/gpio/export
echo 0 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio79/active_low
echo out > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio79/direction
echo 1 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio79/value
chown mks /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio79/value
echo 66 > /sys/class/gpio/export
echo 0 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio66/active_low
echo out > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio66/direction
echo 1 > /sys/devices/platform/pinctrl/ff230000.gpio/gpiochip2/gpio/gpio66/value
@shaileshaanand
shaileshaanand / Readme.md
Created November 17, 2023 18:08
Controlling the ELEGOO Neptune 4 Pro's lights using klipper macros on Stock Klipper install

Disclaimers:

  • This does not work on the Elegoo firmware
  • My Fluidd Macros to Control the LEDs never worked, neither in elegoo fw nor in Stock Klipper (@man_bearpig 's Image), If you are facing the same issue, this tutorial will let you control the LEDs in stock Klipper Install.
  • I do not work for ELEGOO, I'm just a N4Pro user

Thanks @squirrelymoose [Discord] for the helping me figure this out

Tutorial:

@shaileshaanand
shaileshaanand / logid.conf
Created January 24, 2023 18:36
logid.conf
devices: (
{
name: "MX Master 3S";
smartshift:
{
on: true;
threshold: 30;
};
hiresscroll:
{
from itertools import combinations
import math
from random import randint
def solve_naive(nums, k):
mindiff = 10**10
for csol in combinations(nums, k):
ssol = sorted(csol)
# mindiff = min(abs(ssol[-1] - ssol[0]), mindiff)