Skip to content

Instantly share code, notes, and snippets.

View dansteingart's full-sized avatar

Dan Steingart dansteingart

View GitHub Profile
@dansteingart
dansteingart / arduino_listener.ino
Created October 2, 2013 16:13
MAE 221/224 Lab Stuff
void setup(){
Serial.begin(57600);
millis();
//analogReference(DEFAULT);
}
float vals[6];
void RMSAveraged(int time){
/**
* ReadSHT1xValues
*
* Read temperature and humidity values from an SHT1x-series (SHT10,
* SHT11, SHT15) sensor.
*
* Copyright 2009 Jonathan Oxer <[email protected]>
* www.practicalarduino.com
*/
@dansteingart
dansteingart / 0_reuse_code.js
Created January 8, 2014 15:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dansteingart
dansteingart / arb_sort.py
Created January 15, 2014 04:37
Sorting against an arbitrary standard
#Driven By Trello Card Sorting
#We want to preserve this order
color_list = ['green','yellow','orange','red','purple','blue']
dd = [
{'color':'yellow','name':'Jet'},
{'color':'blue','name':'Spike'},
{'color':'green','name':'Faye'},
{'color':'purple','name':'Ed'},
@dansteingart
dansteingart / Figrelli-L12_R_I.ino
Last active November 7, 2025 18:40
Arduino Code to Control an Figrelli L-12 Series (R or I Type) Linear Actuator via PWM/Serial Command
int incomingByte = 0; // for incoming serial data
int pin = 7; //White Cable Goes Here, Red to 5V, Black to GND
void setup() {
//Serial
pinMode(pin,OUTPUT);
Serial.begin(9600); // set up Serial library at 9600 bps
}
@dansteingart
dansteingart / quiner.py
Last active August 29, 2015 14:08
An attempt to have a "rational" whos() (ala matlab)
import __main__
def whos(lss):
fil = __main__.__file__
thisthinghere = open(fil).read().split("\n")
vs = []
for l in thisthinghere:
if l.find("=") > -1:
vs.append(l.split("=")[0].strip())
keys = lss.keys()
out = {}
@dansteingart
dansteingart / nodeforwarder.js
Last active August 29, 2015 14:22
Nodeforwarder
/*
NodeForwader: an serial to http proxy driven by ghetto get calls
requirements
-- serialport -> npm install serialport
-- express -> npm install express
-- sleep -> npm install sleep
-- socket.io -> npm install socket.io
-- cors -> npm install cors
to start: node nodeforwader.js [HTTP PORT] [SERIAL PORT] [BAUD] [BUFFER LENGTH]
@dansteingart
dansteingart / control.py
Created July 1, 2015 14:53
basic ardustat control in python / connect to nodeforwarder
from urllib import urlopen as uo
from time import *
url = "http://localhost:8888" #replace with whatever your port is
def read():
uo(url+"/write/s0000").read()
sleep(.1)
incoming = uo(url+"/read/").read()
return incoming.split("GO,")[-1].split(",ST")[0]
@dansteingart
dansteingart / get_close_time.py
Created November 18, 2016 19:51
get_close_time.py
##Author:
##Date Started:
##Notes:
from pithy import *
import libMotorPhoton as lmp
from datetime import datetime as dt
import time
photon = lmp.motorPhoton("MischievousMelon")

Keybase proof

I hereby claim:

  • I am dansteingart on github.
  • I am steingart (https://keybase.io/steingart) on keybase.
  • I have a public key ASC_Q64zAvx1GtTeV8iI5wXKqNrwBV9IA1pzdRNc1eZN0Qo

To claim this, I am signing this object: