Skip to content

Instantly share code, notes, and snippets.

View eggie5's full-sized avatar
💭
Working on TensorFlow Ranking

Alex Egg eggie5

💭
Working on TensorFlow Ranking
View GitHub Profile
@eggie5
eggie5 / sweep.c
Created March 26, 2014 03:53
tank sweep sharknado
#include <SabertoothSimplified.h>
SabertoothSimplified ST;
void setup()
{
SabertoothTXPinSerial.begin(9600);
@eggie5
eggie5 / serial_slave.cpp
Created March 29, 2014 17:41
connect to a USB host over serial arduino
uint8_t counter;
void setup() {
Serial.begin(115200);
SerialUSB.begin(115200); // speed is irrelevant for native port
counter = 0;
}
@eggie5
eggie5 / loop.c
Created April 26, 2014 07:03
sharknado state machine loop
void loop() {
//next state logic
state=next_state;
if (state==START) start_routine();
else if(state==SEARCH) search_routine();
else if(state==BEACON) beacon_search_routine();
else if(state==ESCAPE) escape_routine();
else if(state==DONE_WAIT) done_wait();
@eggie5
eggie5 / async_ultrasonic.c
Created April 27, 2014 21:31
asynch (non-blocking) ultrasonic sensors for adruino due
#include <DueTimer.h>
#define trigPin1 13 // Pin 12 trigger output
#define trigPin2 11 // Pin 12 trigger output
#define trigPin3 9 // Pin 12 trigger output
#define echoPin1 12 // Pin 2 Echo input
#define echoPin2 10 // Pin 2 Echo input
#define echoPin3 8 // Pin 2 Echo input
#include <Adafruit_GPS.h>
#include "location.h"
#include <string>
#include <Sabertooth.h>
#include <LSM303.h>
#include <Wire.h>
#include <PID_v1.h>
#include <DueTimer.h>
#include <Servo.h> //must include here to to link in payloaddumper.cpp
#include "ProximitySensor.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@eggie5
eggie5 / FastRunningMedian.h
Created May 1, 2014 19:17
shark beacon antenna
//
// Released to the public domain
//
// Remarks:
// This is a lean but fast version.
// Initially, the buffer is filled with a "default_value". To get real median values
// you have to fill the object with N values, where N is the size of the sliding window.
// For example: for(int i=0; i < 32; i++) myMedian.addValue(readSensor());
//
// Constructor:
test
$ curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5804 100 5804 0 0 1580 0 0:00:03 0:00:03 --:--:-- 1604
: command not found
sh: line 2: !DOCTYPE: No such file or directory
sh: line 3: html: No such file or directory
sh: line 4: !--: No such file or directory
sh: line 5: FileName:: command not found
sh: line 6: Language:: command not found
$ node db.js
events:63
this.emit("newListener", type, listener);
^
TypeError: Object #<an Object> has no method 'emit'
at events:63:8
at EventEmitter.Connection (/Users/eggie5/Development/tapioca/dd/lib/postgres-js/lib/postgres-pure.js:304:3)
at onLoad (/Users/eggie5/Development/tapioca/dd/db.js:9:12)