Skip to content

Instantly share code, notes, and snippets.

View mithi's full-sized avatar

Mithi Sevilla mithi

View GitHub Profile
@mithi
mithi / mearm.ino
Last active August 28, 2015 17:22
test mearm
#include <Servo.h>
class Sweeper {
Servo servo;
int pos;
int inc;
int interval;
unsigned long lastUpdate;
int maximum;
int minimum;
// http://www.bajdi.com
// Bob the biped
// Basic walking gait code
#include <Servo.h>
// 4 servos
Servo leftFootServo;
Servo leftHipServo;
Servo rightFootServo;
Servo rightHipServo;
@mithi
mithi / ultrasonicTheremin.ino
Last active October 7, 2015 21:37
ultrasonic Theremin for Sparki
#include <Sparki.h>
void setup() {
}
void ultrasonicTheremin(){
int maxDist = 60;
int minFreq = 50;
int maxFreq = 10000;
@mithi
mithi / lightSensorThereminAll.ino
Last active October 10, 2015 02:55
light sensor theremin (right, center, left) for sparki
#include <Sparki.h>
const int RIGHT = 0;
const int CENTER = 1;
const int LEFT = 2;
const int freqA = 440;
const int freqF = 370;
const int freqmidC = 261;
@mithi
mithi / completeThereminChallenge.ino
Last active October 7, 2015 23:02
complete Theremin Challenge for Sparki
#include <Sparki.h>
const int ULTRASONIC = 0;
const int RIGHT = 1;
const int CENTER = 2;
const int LEFT = 3;
int freqA = 440;
int freqF = 370;
int freqmidC = 261;
@mithi
mithi / lightSensorThereminCalibration.ino
Created October 6, 2015 06:47
Calibration Code for Light Sensor Theremin
#include <Sparki.h>
int sensorLow = 80000;
int sensorHigh = 0;
int sensorValue = 0;
int calibrationTime = 5000;
void setup(){
signal(3, 75);
@mithi
mithi / singleLightSensorTheremin.ino
Created October 6, 2015 06:53
single light sensor theremin for sparki
#include <Sparki.h>
int sensorLow = 335;
int sensorHigh = 872;
int sensorValue;
int freq = 440;
int maxPitchCount = 20;
void setup(){}
@mithi
mithi / adafruitmotorshield.ino
Created October 7, 2015 12:06
adafruit motor shield sample
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
int ledPin = 13;
int onTime = 1000;
int offTime = 500;
void setup() {
pinMode(ledPin, OUTPUT);
}