Skip to content

Instantly share code, notes, and snippets.

@jessherzog
jessherzog / OLEDhearts.ino
Created March 14, 2016 02:13
with Adafruit SSD1306 + gfx library
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES 3
#define XPOS 0
@jessherzog
jessherzog / MPUvis1_PROCv2
Last active March 13, 2016 19:01
final code with new shape and sound! (libraries used: Shapes3D, Sound)
import shapes3d.*;
import shapes3d.utils.*;
import processing.sound.*;
import processing.serial.*;
import processing.opengl.*;
import toxi.geom.*;
import toxi.processing.*;
P_Bezier3D bez;
BezTube btube;
@jessherzog
jessherzog / MPUvis1_PROC
Last active March 13, 2016 00:45
toxiclibs teapot example
import processing.serial.*;
import processing.opengl.*;
import toxi.geom.*;
import toxi.processing.*;
ToxiclibsSupport gfx;
Serial port; // The serial port
char[] teapotPacket = new char[14]; // InvenSense Teapot packet
int serialCount = 0; // current packet byte position
@jessherzog
jessherzog / MPUvis1_ARD
Created March 13, 2016 00:43
jeff rowberg i2c dev library for mpu6050
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
//#include "MPU6050.h" // not necessary if using MotionApps include file
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include "Wire.h"
#endif
MPU6050 mpu;
//MPU6050 mpu(0x69); // <-- use for AD0 high
@jessherzog
jessherzog / servo_2functions.ino
Created March 8, 2016 23:05
group servo – two functions
#include <Servo.h>
Servo myServo;
int deg;
int degree;
int inputDeg;
int ang;
int angle;
@jessherzog
jessherzog / pirate_servo.ino
Last active February 21, 2016 08:51
Pirate hide and seek game incorporating Servo and Piezo outputs, Serial inputs
include <Servo.h>
String myName;
int treasureX, treasureY;
int inputX, inputY;
int nearness;
int servoAngle = 1;
// started servo range at 10 to avoid BAD jittery
// high current state at lowest angles
@jessherzog
jessherzog / LEDmod_2
Created February 18, 2016 19:39
blink twice for every three times the LED is completely off
const int ledPin = 9;
int fade = 0;
int numOff = 0;
void setup() {
for (int i = ledPin; i < ledPin + fade; i++) {
pinMode(ledPin, OUTPUT);
}
}
@jessherzog
jessherzog / LEDmod_1
Created February 18, 2016 19:37
breathing on and off, each half taking 2 seconds
const int ledPin = 9;
int fade = 0;
void setup() {
for (int i = ledPin; i < ledPin + fade; i++) {
pinMode(ledPin, OUTPUT);
}
}
/* The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC / VDD pin to 5V
@jessherzog
jessherzog / boxes2balls_sound.pde
Created December 20, 2015 04:22
3d objects w sound
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
BouncingBox b;
BouncingBox b1;
BouncingBox b2;