From a0be916d62f9ecfedd5b56b4d11260bbe335c460 Mon Sep 17 00:00:00 2001 From: Liz Cray Date: Thu, 28 Mar 2024 21:54:13 -0400 Subject: [PATCH] Printer lighting script --- printer_light.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 printer_light.sh diff --git a/printer_light.sh b/printer_light.sh new file mode 100755 index 0000000..c111a4b --- /dev/null +++ b/printer_light.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +commands=("printer_on" "printer_off" "failed_print_anim") +CMD="" + +if [ "${1}" == "a" ]; then + CMD="${commands[$2]} 00 34" +else + declare -A printer + + # Lulzbot Mini + printer[0,0]="00" + printer[0,1]="06" + + # Ultimaker + printer[1,0]="07" + printer[1,1]="14" + + # Monoprice + printer[2,0]="15" + printer[2,1]="22" + + # Lulzbot Taz + printer[3,0]="23" + printer[3,1]="34" + + CMD="${commands[$2]} ${printer[$1,0]} ${printer[$1,1]}" +fi + +echo "${CMD}" | nc lumen1.local 5000 \ No newline at end of file