Skip to content

Instantly share code, notes, and snippets.

@devdsp
devdsp / GoL.v
Created June 6, 2011 04:53
Conway's Game of Life in Verilog
/*
Conway's Game of Life modeled in Verilog by Adam Thomas / devdsp
*/
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <github.com/devdsp> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. - Adam
#define ENC_MASK B10000100
#define ENC_STATE0 B00000000
#define ENC_STATE1 B10000000
#define ENC_STATE2 B10000100
#define ENC_STATE3 B00000100
const byte PIN_ENC_A = 2;
const byte PIN_ENC_B = 7;
const byte PIN_ENC_P = 8;

Keybase proof

I hereby claim:

  • I am devdsp on github.
  • I am devdsp (https://keybase.io/devdsp) on keybase.
  • I have a public key whose fingerprint is 4FAB 9EF0 22FE 9941 C516 C179 D948 E348 19E3 6475

To claim this, I am signing this object:

#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent::I3 qw(:all);
my $i3 = i3();
$i3->connect->recv or die "Error connecting to i3";
my $output = undef;
devdsp:
name: Adam Thomas
twitter: dev_dsp
@devdsp
devdsp / main.py
Created November 27, 2013 03:27
Colour Palette generator using PythonMagick
#!/usr/bin/env python
from PythonMagick import Image, Color
from math import atan2, pi, pow,sqrt
img = Image('128x128', 'white')
xo = img.columns() / 2
yo = img.rows() / 2
for x in range(img.columns()):
for y in range(img.rows()):
@devdsp
devdsp / centre.pl
Created November 14, 2013 05:27
a few unfinished scripts for the Roland GRX400 drafting plotter
#!/usr/bin/perl
use strict;
use warnings;
my ($minx,$miny,$maxx,$maxy);
while(<>) {
chomp;
foreach my $cmd (split/;/) {
@devdsp
devdsp / rfid-checkin.ino
Last active December 21, 2015 22:59
fixed a roll through bug in the report switch
#include <string.h>
#include <Ethernet.h>
#include <SPI.h>
#include <HttpClient.h>
#include <EthernetClient.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xE0, 0xFE, 0xED };
char server[] = "morphia.mhv";
@devdsp
devdsp / TinyNorthToe.ino
Last active December 21, 2015 13:59
TinyNorthToe
#include <TinyWireM.h>
#define HMC5883L 0x1E //0011110b, I2C 7bit address of HMC5883
void pulse(int n){
  while(n-- > 0) {
    digitalWrite(1,HIGH);
    delay(1);
    digitalWrite(1,LOW);
    delay(1);
  }
@devdsp
devdsp / NorthToe.ino
Last active December 18, 2015 03:49
simple north paw
#include <Wire.h>
void setup()
{
Wire.begin();
}
void loop()
{
Wire.beginTransmission(0x21);
Wire.write("A");