Skip to content

Instantly share code, notes, and snippets.

View guyc's full-sized avatar

Guy Carpenter guyc

  • Clearwater Software
  • Australia
View GitHub Profile
@guyc
guyc / sketch_may01a.ino
Created May 1, 2013 04:28
The file that is currently on an Arduino Uno with a serial number of 6493234383835120E1B0
#include "LPD8806.h"
#include "SPI.h"
// Example to control LPD8806-based RGB LED Modules in a strip
/*****************************************************************************/
// Number of RGB LEDs in strand:
int nLEDs = 32;
// number that we will not be writing to
@guyc
guyc / gist:5472760
Created April 27, 2013 11:25
openscan source for one tentacle arc.
// arc is defined by the inner radius
small = 1;
$fa = 4;
//$fs = 1;
segmentInnerRadius = 300;
segmentArc = 10; // degrees
segmentWidth = 40;
@guyc
guyc / find-duplicates.py
Created April 26, 2013 03:45
Script for finding duplicate image files created by picasa import.
#!/usr/bin/env python
# Picasa sometimes duplicates imports and it adds a -NNN
# suffix (older versions seemed to use -N). This code
# finds files with this naming scheme, and looks for the base
# file in the same dirctory. If it finds the base, and the
# base has the same length, same md5 hash, the duplicate
# is suggested for deletion.
# Output is a set of 'rm <filename>' commands that can
@guyc
guyc / gist:5088179
Created March 5, 2013 05:11
Testing UDP broadcast on unconfigured network
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <net/if.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <errno.h>
#include <stdio.h>
@guyc
guyc / font_test2.py
Created November 18, 2012 23:56
code for testing font layout using py-gaugette.ssd1306
import gaugette.ssd1306
from gaugette.fonts import arial_16
from gaugette.fonts import arial_mono_15
RESET_PIN = 15
DC_PIN = 16
buffer_width = 128
@guyc
guyc / i2ctest.c
Created September 17, 2012 05:08
Testing driving a SwitecX25 stepper over i2c using an MCP23008 I/O chip
#include <stdio.h>
#include <stdlib.h>
#include <linux/i2c-dev.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@guyc
guyc / ConstantSpeedTest.ino
Created May 4, 2012 00:09
The file that is currently on an Arduino Uno with a serial number of 6493832333135140D160
#define PIN_VCC 3
#define PIN_GND 4
#define PIN_SENSE A0
#define FORWARD 1
#define REVERSE -1
#define SAFE_DELAY 1000
#define COUNT_DELAY 1000
@guyc
guyc / Command.cpp
Created May 3, 2012 03:33
The file that is currently on an Arduino Uno with a serial number of 64932343738351217080
/*
Copyright (c) 2011 Guy Carpenter
*/
#include <Arduino.h>
#include "Command.h"
#define CMDBUF_LEN 40
/*
This software uses a BSD license.
Copyright (c) 2010, Sean Cross / chumby industries & Limor Fried / adafruit industries (we are both industrious people, eh?)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@guyc
guyc / 2.6.28.diff
Created February 16, 2012 06:41
Shows the differences in the boot log between the stock Chumby disk image and the 2.6.28 OpenEmbedded build from https://github.com/clearwater/chumby-linux
--- bootlog.stock.tmp 2012-02-17 15:02:18.000000000 +1000
+++ bootlog.2.6.28.tmp 2012-02-17 15:02:18.000000000 +1000
@@ -5,37 +5,37 @@
Skipping 3968 chunks
Jumping to address 0x40808000:
0x00000000 0f 00 a0 e1 08 00 40 e2 02 0a 40 e2 08 10 9f e5 |......@...@.....|
-0x00000010 00 00 81 e5 02 00 00 eb 25 05 00 eb 20 20 00 00 |........%... ..|
+0x00000010 00 00 81 e5 02 00 00 eb d8 04 00 eb 20 80 80 40 |............ ..@|
0x00000020 11 b1 11 c1 14 00 9f e5 14 10 9f e5 00 20 a0 e3 |............. ..|
0x00000030 04 20 80 e4 01 00 50 e1 fc ff ff 3a 0e f0 a0 e1 |. ....P....:....|