Skip to content

Instantly share code, notes, and snippets.

// Code by Jeremy Nir 2014
// Frankensteined together from Servo example and Digital Read examples on Arduino.cc
// short and sweet code that turns on a power bar when a coin is inserted
#include <Servo.h>
int servoPin = 9;
Servo servo;
//int angleON = 68; // servo flicks to it's left
//int angleOFF = 58; // servo flicks to it's right
int knob0;
//int knob1;
void setup() {
// initialize the serial communication:
Serial.begin(9600);
}
void loop() {
knob0=analogRead(A0);
// Adapted from the Graphing sketch by Jeremy Nir
import processing.serial.*;
PImage img;
Serial myPort; // The serial port
int knobby = 1; // horizontal position of the graph
@jerog1
jerog1 / gist:9754544
Created March 25, 2014 03:05
ball-mover Arduino
#include <Servo.h>
Servo servo1; Servo servo2;
void setup() {
pinMode(1,OUTPUT);
servo1.attach(9); //analog pin 0
//servo1.setMaximumPulse(2000);
@jerog1
jerog1 / gist:9754519
Created March 25, 2014 03:03
ball-mover Processing
/**
* 2 x Servo Mouse Controller adapted
* Jeremy Nir 2014
* Adapted from original code by Fairlane
*/
import processing.serial.*; // Use the included processing code serial library
// Jeremy Nir - Physical Computing 2014
// This code turns on an LED to let you know that you're out of aluminum foil.
const int ledPin = 13;
const int inputPin = 2;
void setup() { pinMode(ledPin, OUTPUT);
pinMode(inputPin, INPUT);
}