Skip to content

Instantly share code, notes, and snippets.

View ricklon's full-sized avatar

Rick Anderson ricklon

View GitHub Profile
python3 train.py ulysses/curated
/* Sample RC servo input for 4 channels using Input Capture hardware perihperal and interrupts
* Written for Rick Anderson by Brian Schmalz
* 11/11/2017
* This software is put in the public domain.
* This sketch is means for a chipKIT Fubarino SD board, but can be easily adpated to any PIC32 based Arduino compatible board.
*/
/* Fubarino SD can only use pins 0, 1, 2, 3, and 10 as Input Capture.
* On any chipKIT board with PPS (like Fubarino Mini) additional setup is necessary to map the Input Capture
* peripherals to speciffic I/O pins, but you have much more flexibility in pin assignments.
/* Sample RC servo input for 4 channels using Input Capture hardware perihperal and interrupts
Written for Rick Anderson by Brian Schmalz
11/11/2017
This software is put in the public domain.
This sketch is means for a chipKIT Fubarino SD board, but can be easily adpated to any PIC32 based Arduino compatible board.
*/
/* Fubarino SD can only use pins 0, 1, 2, 3, and 10 as Input Capture.
On any chipKIT board with PPS (like Fubarino Mini) additional setup is necessary to map the Input Capture
peripherals to speciffic I/O pins, but you have much more flexibility in pin assignments.
app.controller("lineCtrl", function($scope, socket) {
var timeFormat = 'MM/DD/YYYY HH:mm:ss';
var color = Chart.helpers.color;
function newDateString(seconds) {
return moment().add(seconds, 's').format();
}
function newTimestamp(days) {
return moment().add(days, 'd').unix();
@ricklon
ricklon / collect.py
Created July 6, 2017 14:26
Sanmesh's updated collect.py with buttons
import os
import math
import numpy as np
import glob
import scipy
import scipy.misc
import datetime
import time as timemod
import RPi.GPIO as GPIO
import argparse
@ricklon
ricklon / masterButtons.py
Created July 6, 2017 14:25
Sanmesh's master button example
import RPi.GPIO as GPIO
import time
import numpy as np
import collect
gpio_collectOn = 18;
gpio_collectOff = 16;
gpio_saveToUsb = 17;
@ricklon
ricklon / shutdownButton.py
Last active July 6, 2017 14:24
Shutdown Button Example from Sanmesh
import RPi.GPIO as GPIO
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(14, GPIO.IN, pull_up_down=GPIO.PUD_UP)
try:
GPIO.wait_for_edge(14, GPIO.FALLING)
#Use falling edge detection to see if pin is pulled
const config = require('config');
const logger = require('winston');
const five = require('johnny-five');
const PIN_LED1 = 1; // Fubarino_mini pin 1
// const A0 = 0;
const board = new five.Board({
port: config.get('port'),
});
// #define IS_PIN_ANALOG(p) ((p) == 0 || ((p) >= 3 && (p) <= 13))
// #define PIN_TO_ANALOG(p) ((p) == 0 ? 0 : ((((p) >= 1 && (p) <= 11)) ? ((p) + 2) : (p)))
#include <Servo.h>
#include <Wire.h>
#include <Firmata.h>
void setup() {
pinMode(PIN_BTN1, INPUT);
Serial.begin(9600);
}
//Test Routine Program - By Stezipoo
#include <Servo.h>
//create servo objects
Servo steering;
Servo throttle;
int ledPin = 13;