This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ReadSHT1xValues | |
* | |
* Read temperature and humidity values from an SHT1x-series (SHT10, | |
* SHT11, SHT15) sensor. | |
* | |
* Copyright 2009 Jonathan Oxer <[email protected]> | |
* www.practicalarduino.com | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
Serial.begin(57600); | |
millis(); | |
//analogReference(DEFAULT); | |
} | |
float vals[6]; | |
void RMSAveraged(int time){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
from glob import glob | |
port = glob("/dev/tty.u*")[0] | |
ser = serial.Serial(port,57600) | |
ser.open() | |
ser.timeout = .5 | |
def write(string): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
from glob import glob | |
from time import sleep | |
port = glob("/dev/tty.usb*")[0] | |
ard = serial.Serial(port,57600) | |
print "waiting to start" | |
for i in range(3,0,-1): | |
print i, | |
sleep(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code to set set current here | |
for i in range(120): | |
#code to get data here | |
time.sleep(.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//First make placeholders for results as globals | |
results = {} | |
processes = {} | |
//Now Spawn Processes within code you need, where index is an identifier | |
spawn_list[index] = spawn(/*file here*/) | |
processes[index] = spawn_list[index].pid | |
results[processes[index]] = {} | |
results[processes[index]]['index'] = index //funny looking but important | |
results[processes[index]]['stdout'] = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var child; | |
//Put path to mongoexport here | |
mel = "/Users/ardustat/Downloads/mongodb-osx-x86_64-2.0.2/bin/mongoexport" | |
function mongoexport(collection) | |
{ | |
out_string = mel + " -csv -o "+collection+".csv -d ardustat -c "+collection+" -f time,cell_potential,working_potential,current" | |
child = exec(out_string, function (error, stdout, stderr) |