Skip to content

Instantly share code, notes, and snippets.

import time
import board
import neopixel
from digitalio import DigitalInOut, Direction, Pull
from adafruit_debouncer import Debouncer
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
View 10V-off.txt
>>>> adc1
ADC1 settings
Parsing error:
SR : 0x00000000 [0x40012400]
Parsing error:
CR1 : 0x00000000 [0x40012404]
Parsing error:
CR2 : 0x00000000 [0x40012408]
Parsing error:
SMPR1 : 0x00000000 [0x4001240c]
keyz182 /
Last active Apr 20, 2020
3D Print notification - SMS + image url
Listens to a Duet over USB
Configure your slicer to add M118 P1 S"###END###" to the end of your GCode
Ensure "port" points to the Duet serial port
Configure the following parameters:
- twilio_account_sid - from
- twilio_auth_token - from
- s3_bucket - your S3 bucket name
- s3_url - Add in the region instead of ####
import serial, time, json, io, os, requests, datetime, sys, traceback, logging
from systemd import journal
log = logging.getLogger('timelapse')
port = '/dev/serial/by-id/usb-Duet3D_Duet-if00'
baud = 115200
keyz182 / test.sol
Created Mar 27, 2019
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at
View test.sol
pragma solidity ^0.5.1;
pragma experimental ABIEncoderV2;
contract TestContract {
constructor() public {}
struct Foo { uint8 bar; uint8 baz; }
function test (Foo[] calldata input) external {}
keyz182 / bed.g
Last active Feb 9, 2019
Duet Wifi Hypercube Evolution (20190209)
View bed.g
; bed.g
; called to perform automatic bed compensation via G32
; generated by RepRapFirmware Configuration Tool on Tue Feb 27 2018 20:56:15 GMT+0000 (GMT Standard Time)
M561 ; clear any bed transform
; G28 ; home all axes
; Probe the bed at 5 points
G1 X60 Y60 Z5 F9000 ; Move to bed
G4 P1500
View laser-test-raster.gcode
This file has been truncated, but you can view the full file.
; Generated with:
; "Duet Raster 2 Laser Gcode generator"
; by 305 Engineering
G28; home all axes
G21; Set units to millimeters
G90; Use absolute coordinates

Controlling a PWM Laser with the Duet Board


  • Your laser runs on 12v
  • Your laser requires a 5v active-high PWM
  • You want to control the laser wit M3 and M5 commands
  • You have a laser module
  • You have a Duet board
View Duet-Laser-PWM.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
keyz182 / config.g
Last active Jul 26, 2018
View config.g
; General preferences
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
M667 S1 ; Select CoreXY mode
; Network
M550 P******** ; Set machine name
M552 S1 ; Enable network
M587 S"********" P""********"" ; Configure access point. You can delete this line once connected