Skip to content

Instantly share code, notes, and snippets.

View Frijol's full-sized avatar

Kelsey Frijol

View GitHub Profile
var tessel = require('tessel');
var led1 = tessel.led(1).output().high();
var led2 = tessel.led(2).output().low();
setInterval(function () {
led1.toggle();
led2.toggle();
}, 100);
@Frijol
Frijol / NodeHttpOnTessel.js
Last active August 29, 2015 14:01
Making an HTTP GET with Node http module on Tessel
var http = require('http');
console.log('http get...');
http.get("http://api.openweathermap.org/data/2.5/weather?id=5327684&units=imperial", function(res) {
console.log(res.statusCode);
if (res.statusCode == 200) {
var body = '';
res.on('data', function(chunk) {
body += chunk;
@Frijol
Frijol / tessel-camera
Created July 27, 2014 21:03
tessel-camera
// Require libraries
var tessel = require('tessel');
var camera = require('camera-vc0706').use(tessel.port['A']);
// Set up an LED to notify when we're taking a picture
var notificationLED = tessel.led[3];
// When the camera is ready, print a message in the console.
camera.on('ready', function () {
console.log('Press the config button to take a picture!');
var location = 'San Francisco' // Write where you're tweeting from!
// Node requires
var fs = require('fs');
var https = require('https');
var crypto = require('crypto');
// Set up to Tweet
var bound = require('crypto').pseudoRandomBytes(16).toString('hex');
var ctype = 'multipart/form-data; boundary=' + bound;
@Frijol
Frijol / workingcontrolwfrosting
Created August 22, 2014 17:44
Arduino Control AutoFrost
const int logicpinx = 8;
const int pulsepinx = 9;
const int logicpiny = 10;
const int pulsepiny = 11;
const int frostpin = 12;
const int limitpinx = 3;
const int limitpiny = 4;
int limitpin;
int logicpin = logicpinx;
int pulsepin = pulsepinx;
@Frijol
Frijol / FinalCakeGui
Created August 22, 2014 17:46
AutoFrost Cake Python GUI
# Last modified 12/14/2010
#
# Purpose: This code generates all parts of the cake creation GUI,
# converts user input to motor commands, and sends those commands to the arduino
from Tkinter import *
import sys
import serial
class Callable:
@Frijol
Frijol / wifi
Last active August 29, 2015 14:11
Gets wifi on and keeps it alive on a Tessel
var wifi = require('wifi-cc3000');
var wifiSettings = {
ssid: "technicallyWifi",
password: "scriptstick",
timeout: 40
};
var port = 8000;
var connected = false;
var debug = false;
require('tesselate') ({
modules: {
A: ['ambient-attx4', 'ambientL'],
C: ['ambient-attx4', 'ambientR']
},
}, function(tessel, modules) {
var left = modules.ambientL;
var right = modules.ambientR;
console.log('For left module calibration:');
sample(left, function (leftData) {
User controls:
* Quantity of photos
* Frequency (once/day vs once/week?)
* How do you moderate who you follow?
You'd still have to have a Facebook account, it would just email you photos instead of
#!/bin/sh
NAME="arnold"
LOCAL="/Users/frijol/t2-firmware"
REMOTE="/usr/lib/node"
scp -i ~/.tessel/id_rsa $LOCAL/node/tessel.js root@$NAME.local:$REMOTE/tessel.js;
scp -i ~/.tessel/id_rsa $LOCAL/node/tessel-export.js root@$NAME.local:$REMOTE/tessel-export.js;