Skip to content

Instantly share code, notes, and snippets.

View jadudm's full-sized avatar

Matthew Jadud jadudm

View GitHub Profile
@jadudm
jadudm / testing_transistor_gates.ino
Created January 23, 2014 15:39
Testing Transistor Gates
int pinA = 8;
int pinB = 9;
int lvlA;
int lvlB;
int delayTime = 3000;
void setup () {
Serial.begin(9600);
pinMode (pinA, OUTPUT);
pinMode (pinB, OUTPUT);
@jadudm
jadudm / tmp36-sls.ino
Last active January 2, 2016 08:28
A simple sense-log-sleep loop for the TMP36.
/**************************************
* VARIABLES AND PINS
**************************************/
/* Declare a variable to store the sensor reading. */
int theReading;
/* Declare the pin we have attached the sensor to. */
int TMP36 = A0;
@jadudm
jadudm / led.ino
Created November 11, 2013 12:37
Craft of Electronics Tutorial: Turning an LED On http://craftofelectronics.org/
// Turning things on and off.
void setup () {
// First, tell the Arduino we want to make one
// of our pins an OUTPUT pin.
pinMode(13, OUTPUT);
}
void loop () {
// Tell the Arduino to turn on one of our pins.
digitalWrite(13, HIGH);
@jadudm
jadudm / README.md
Created August 29, 2013 14:40
List and Debug support code from PintOS.

To Compile

To compile the code in this example, you can do

gcc -I. -o run_me support.c list.c starter.c

which you can convert to a Makefile at your leisure.

@jadudm
jadudm / bash-test-script.py
Last active December 21, 2015 22:49
bash-test-script.py for os-f13
import sys, os
import random, time
from subprocess import call
since_epoch = time.time()
assignment_directory = "assignment-%s" % since_epoch
num_files = random.randint(5, 15)
num_garbage = random.randint(5, 15)
@jadudm
jadudm / gist:6354720
Created August 27, 2013 15:01
A simple Makefile
all:
gcc -o hello-os hello.c
@jadudm
jadudm / left-hand.ino
Created June 11, 2013 20:29
Radios talking to each-other.
//send data routine
// link between the computer and the Serial Shield
//at 9600 bps 8-N-1
//Computer is connected to Hardware UART
//Serial Shield is connected to the Software UART:D2&D3
// # LEFT /dev/tty.usbserial-A901N3TL
#include <SoftwareSerial.h>
@jadudm
jadudm / test-001.asm
Created March 25, 2013 16:54
A test file for use with the Hack assembler/CPU emulator.
// Test 001
// Source:
//
// (let ((x0 7)) (let ((x1 2)) (if (> (+ 2 2) (if (> 4 x1) 2 0)) (+ x0 x0) x0)))
//
// Result (in RAM0): 14
// Generated on 20130309 at 19:54.
// -----------------------------------//
@7
D=A
@jadudm
jadudm / assembler-outline.py
Created March 23, 2013 13:23
Rough outline of assembler.
# Your program should probably end with this function, and call
# it to do everything.
def main():
inf = sys.argv[1]
outf = sys.argv[2]
los = readFileToListOfLines(inf)
# Print here to see if things look right
losclean = stripEveryLine(los)
@jadudm
jadudm / variables.ino
Created March 3, 2013 17:16
Introducing variables on the Arduino.
// Turn two LEDs on then off.
// Declare variables for later use.
int greenLED;
int redLED;
void setup () {
// Assign values to our variables.
greenLED = 2;
redLED = 4;