Skip to content

Instantly share code, notes, and snippets.

View adamgreig's full-sized avatar

Adam Greig adamgreig

View GitHub Profile
import sys
import time
import socket
import datetime
import numpy as np
import matplotlib.pyplot as plt
if len(sys.argv) != 4:
print("Usage: psudmm.py <Channel> <Max Voltage> <Voltage Step>")
sys.exit(1)
`timescale 10ns / 1ns
module FIR
(
input reset,
input clock,
input [11:0] u,
output [11:0] y
);
@adamgreig
adamgreig / fpga_lfsr_100M.png
Last active October 23, 2017 05:53
migen lfsr on de0-nano
fpga_lfsr_100M.png
import io
import sys
import time
import socket
import struct
from PIL import Image
if len(sys.argv) != 2:
print("Usage: screenshot_dmm.py <filename>")
@adamgreig
adamgreig / Makefile
Last active August 29, 2015 14:27
BladeRF 10MHz Clock Output
all:
gcc -g -c main.c -Wall -Werror -Wpedantic
gcc -g main.o -lpthread -lm -lbladeRF -Wall -Werror -Wpedantic -o bladerf-10mhz
@adamgreig
adamgreig / hrfpsk31.c
Created April 16, 2015 11:09
PSK31 Modulator in C for HackRF
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "libhackrf/hackrf.h"
#include "psk31_varicode.h"
/*
@adamgreig
adamgreig / 00-README.md
Last active August 12, 2022 08:37
Run embedded Rust code on your STM32F4

Embedded Rust on STM32F4

My notes from implementing Job Vranish's excellent guide.

Follow along with the guide above, getting rustc from rustup or similar:

rustc 1.0.0-nightly (dcaeb6aa2 2015-01-18 11:28:53 +0000)
binary: rustc
commit-hash: dcaeb6aa23ecba2dc2af870668a9239136d20fa3

commit-date: 2015-01-18 11:28:53 +0000

/*///------------------------------------------------------
LPTMon - monitor CPU activity and new mail/RSS, display |
this on a series of LEDs connected to parallel |
port one (0x378). If there's a button on input |
one of LPT (pin 10), pressing that clears the |
new email/RSS status. |
To configure your mail/RSS reader, have it |
execute this program with either "newrss" or |
"newemail" as the first argument, to indicate |
a new item, or "norss" / "noemail" to indicate |
@adamgreig
adamgreig / icalcombine.py
Created October 22, 2014 14:13
Read multiple iCal / ICS files from URLs, then produce a merged output with all repeating events and all events that will end today or later.
#!/usr/bin/env python
"""
iCal Combine
./icalcombine.py <input URLs file> <output filename>
Read ICS (iCAL) URLs, one per line, from the <input URLs files>, then combine
into a single iCal which is written to <output filename>.
"""
import sys

Keybase proof

I hereby claim:

  • I am adamgreig on github.
  • I am adamgreig (https://keybase.io/adamgreig) on keybase.
  • I have a public key whose fingerprint is 872A 023F AE11 1487 1C0A AEB5 80E6 DEA2 6ADA CD09

To claim this, I am signing this object: