Skip to content

Instantly share code, notes, and snippets.

@thegaragelab
thegaragelab / levelcheck.py
Created January 28, 2015 08:16
Scripts and tools for measuring axis movement using LinuxCNC.
#!/usr/bin/env python
#----------------------------------------------------------------------------
# 11-Jan-2015 ShaneG
#
# Turn the results of the autoprobe log into a PNG file for visualisation.
#----------------------------------------------------------------------------
from sys import argv
from os.path import splitext
from random import random
from PIL import Image
@thegaragelab
thegaragelab / pcbpack.py
Created November 17, 2014 04:00
A Python script to combine multiple g-code files from Line Grinder into a single PCB panel in a (hopefully) optimal layout.
#!/usr/bin/env python
#----------------------------------------------------------------------------
# 13-Nov-2014 ShaneG
#
# Some slight changes to the code for consistancy with the output generated
# by 'linegrinder'. The origin is now in the lower left corner, x increments
# upwards, y increments to the right. The boards are now treated with the
# same origin location (this is what linegrinder generates).
#
# Rotations are in the counter clockwise direction with the working origin
@thegaragelab
thegaragelab / README.md
Last active August 29, 2015 14:01
Simple 4 channel FET driver breakout board.

This is a very simple 4 channel FET driver breakout board based around the 2N7000 N Channel FET in TO-92 format. It can be driven by both 3.3V and 5V digital outputs and allows you to switch up to 60V and 200mA. It is a nice simple solution for driving LED's or other low power devices from a microcontroller or Raspberry Pi.

The other files in this gist include a PDF of the (single layer) PCB suitable for toner transfer etching and an image of the schematic. It fits neatly on a breadboard making it a useful addition to your prototyping tools.

@thegaragelab
thegaragelab / README.md
Created May 2, 2014 08:35
Image capture for Tektronix TDS 1012 Oscilloscope

This is a simple Python script to capture screen shots from a Tektronix scope, rotate them to landscape mode and convert them to PNG. The script simply sits in the background monitoring the serial port and creating the images in a specified directory.

The following settings are required on the TDS 1012:

  1. Printing in PCX format to the RS232 port.
  2. RS232 set to 19200N81.

A null modem cable is required to connect the scope to a PC, I used a USB to DB9 serial adaptor on the PC end.

@thegaragelab
thegaragelab / README.md
Last active April 11, 2024 21:03
Driving a Nokia 5110 LCD with the ATtiny85 Template Library

This gist provides sample code for using Nokia 5110 displays using the ATtiny85 template library. For a full description of code behind this please see this post on The Garage Lab website.

To use this sample code first clone the ATtiny85 template repository and then replace 'main.c' with the source provided here.

@thegaragelab
thegaragelab / README.md
Created April 24, 2014 23:19
Reading an analog keypad on the ATtiny85