Skip to content

Instantly share code, notes, and snippets.

@hephaestus9
hephaestus9 / gist:d4945bc6eded584dafc2
Created October 4, 2014 20:55
Getting Microsoft LifeCam VX-500 working on BBB w/ Ubuntu 14.04
cd /opt/scripts/
sudo git pull
sudo ./tools/update_kernel.sh --beta-kernel
sudo reboot
@hephaestus9
hephaestus9 / SieveOfAtkin.py
Last active August 29, 2015 14:09
Sieve Of Atkin
# -*- coding: utf-8 -*-
# algorithm from http://en.wikipedia.org/wiki/Sieve_of_Atkin
# written by J.Brian 11/17/2014
import math
import threading
class Sieve:
def __init__(self):
@hephaestus9
hephaestus9 / SieveOfAtkin-Java.java
Last active June 13, 2017 14:50
Sieve Of Atkin - Java
/*
* The function of this class is to find all prime numbers in range given by the user.
*
* This homework assignment requires several references:
* http://www.avajava.com/tutorials/lessons/how-do-i-use-threads-join-method.html
* http://stackoverflow.com/questions/1428786/best-way-to-find-a-prime-number
* http://web.mit.edu/16.070/www/lecture/big_o.pdf
* http://en.wikipedia.org/wiki/Sieve_of_Atkin
* http://stackoverflow.com/questions/3790142/java-equivalent-of-pythons-rangeint-int
* http://stackoverflow.com/questions/17279519/removing-items-from-list-in-java
@hephaestus9
hephaestus9 / Motor_Control_STBD.ino
Last active August 29, 2015 14:13
Code for Stbd side of ROV
//J.Brian 1-22-2015
// inputString format:
// vert, port, stbd, aux1, aux2, aux3
// Control -> Forward:
// DIO 4, PWM 5 -> Forward
// DIO 2, PWM 3 -> Reverse
// Slave Control 1 -> Vert:
// DIO 7, PWM 6 -> Up
@hephaestus9
hephaestus9 / Motor_Control_Port.ino
Last active August 29, 2015 14:13
Code for Port side of ROV
//J.Brian 1-22-2015
// inputString format:
// vert, port, stbd, aux1, aux2, aux3
// Control -> Forward:
// DIO 4, PWM 5 -> Forward
// DIO 2, PWM 3 -> Reverse
// Slave Control 1 -> Vert:
// DIO 7, PWM 6 -> Up
@hephaestus9
hephaestus9 / Stellaris_Launchpad_Motor_Driver.ino
Last active August 29, 2015 14:13
Code to drive motor controllers, and other misc.
//J.Brian 1-22-2015
// inputString format:
// vert, port, stbd, aux1, aux2, aux3
#include <SerialBuffer.h>
// change this to Serial1 etc if you're using an Arduino Mega
#define SERIAL_PORT Serial
#define BUFFER_SIZE 64
@hephaestus9
hephaestus9 / gist:905910819e97994cb578
Created February 7, 2015 16:14
Setup to run ROV.py
For this program I highly recommend the use of 'Guake', additionally for proper display I recommend Opera beta on a 64bit ubuntu install
http://www.opera.com/computer/beta
sudo apt-get install guake
start guake press F12 for terminal window
sudo apt-get install build-essential python-dev python-setuptools python-pip
@hephaestus9
hephaestus9 / BBB_Code.py
Last active August 29, 2015 14:15
BBB Code
# -*- coding: utf-8 -*-
# J.Brian 1-22-2015
import Adafruit_BBIO.UART as uart
import socket
import serial
import threading
import ast
import time
from random import randint
@hephaestus9
hephaestus9 / Stellaris_Launchpad_Sensor_Board.ino
Created February 15, 2015 13:17
Sensor Board - Stellaris Launchpad
/***************************************************************************************************************
* Razor AHRS Firmware v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" (SEN-10125 and SEN-10736)
* and "9DOF Sensor Stick" (SEN-10183, 10321 and SEN-10724)
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
/*
MS5541 Pressure Sensor calwords readout
This program will read your MS5441 or compatible pressure sensor every 5 seconds and show you the calibration words, the calibration factors,
the raw values and the compensated values of temperature and pressure.
Once you read out the calibration factors you can define them in the header of any sketch you write for the sensor.
Pins:
MS5541 sensor attached to pins 10 - 13:
MOSI: pin 11