Permalink
Browse files

housekeeping (removed old files from feb from repo), fixed markdown typo

  • Loading branch information...
1 parent 63306e1 commit 5e0140da5eaac3d846a265425ebdcab8d289f796 @100ideas 100ideas committed Jul 20, 2010
View
@@ -8,6 +8,11 @@
*.exe
*.o
*.so
+*.cpp
+*.eep
+*.elf
+*.hex
+*.a
# Packages #
############
View
@@ -21,14 +21,17 @@ modded ps3eye: <http://www.dusseiller.ch/labs/?p=912> (I used a small spot of su
setup
-----
-1. upload ServoFirmata\_9\_11.pde to your arduino and connect the servo control wires to the +5v, ground, and digital pins 9 and 11. You will want a breadboard to breakout the power bus to the servos.
+1.
+upload ServoFirmata\_9\_11.pde to your arduino and connect the servo control wires to the +5v, ground, and digital pins 9 and 11. You will want a breadboard to breakout the power bus to the servos.
- On TPro SG90 or HTX900 microservos, the wiring colors correspond to:
- - yellow: control
- - red: 5 volts
- - brown: ground
+On TPro SG90 or HTX900 microservos, the wiring colors correspond to:
-2. run ucam\_ps3.pde in processing and click around.
+- yellow: control
+- red: 5 volts
+- brown: ground
+
+2.
+run ucam\_ps3.pde in processing and click around.
@@ -1,39 +0,0 @@
-/* This firmware supports as many servos as possible using the Servo" library
- * included in Arduino 0012
- *
- * TODO add message to configure minPulse/maxPulse/degrees
- *
- * This example code is in the public domain.
- */
-
-#include <Firmata.h>
-#include <Servo.h>
-
-Servo servo9;
-Servo servo11;
-
-void analogWriteCallback(byte pin, int value)
-{
- if(pin == 9)
- servo9.write(value);
- if(pin == 11)
- servo11.write(value);
-}
-
-void setup()
-{
- Firmata.setFirmwareVersion(0, 2);
- Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
-
- servo9.attach(9);
- servo11.attach(11);
-
- Firmata.begin(57600);
-}
-
-void loop()
-{
- while(Firmata.available())
- Firmata.processInput();
-}
-
@@ -1,86 +0,0 @@
-import processing.serial.*;
-
-import cc.arduino.*;
-
-import oscP5.*;
-import netP5.*;
-
-OscP5 oscP5;
-NetAddress myRemoteLocation;
-
-Arduino arduino;
-int servoPin = 9;
-
-void setup() {
- size(512, 200);
-
- arduino = new Arduino(this, Arduino.list()[0], 57600);
- //arduino.pinMode(servoPin, Arduino.OUTPUT);
-
- println("\n zeroing servo\n");
- arduino.analogWrite(servoPin, 90);
-
- oscP5 = new OscP5(this,12000);
-
- /* myRemoteLocation is a NetAddress. a NetAddress takes 2 parameters,
- * an ip address and a port number. myRemoteLocation is used as parameter in
- * oscP5.send() when sending osc packets to another computer, device,
- * application. usage see below. for testing purposes the listening port
- * and the port of the remote location address are the same, hence you will
- * send messages back to this sketch.
- */
- myRemoteLocation = new NetAddress("127.0.0.1",12000);
-
- /* osc plug service
- * osc messages with a specific address pattern can be automatically
- * forwarded to a specific method of an object. in this example
- * a message with address pattern /test will be forwarded to a method
- * test(). below the method test takes 2 arguments - 2 ints. therefore each
- * message with address pattern /test and typetag ii will be forwarded to
- * the method test(int theA, int theB)
- */
-
- oscP5.plug(this,"servo","/servo");
-
-}
-
-public void servo( int x ){
- println("### plug event method. received a message /servo.");
- println(" servoWrite: "+x);
- arduino.analogWrite(servoPin, x);
- // arduino.servoWrite(servoPin, x);
-}
-
-void draw() {
- background(constrain(mouseX / 2, 0, 255));
-// arduino.analogWrite(servoPin, constrain(mouseX / 2, 0, 180));
-// arduino.analogWrite(11, constrain(255 - mouseX / 2, 0, 30));
-}
-
-void mousePressed() {
-
- OscMessage servoMessage = new OscMessage("/servo");
-
- println(" clicked: " + mouseX);
-
- servoMessage.add( constrain(mouseX / 2, 0, 175) );
-
- /* send the message */
- oscP5.send(servoMessage, myRemoteLocation);
-}
-
-/* incoming osc message are forwarded to the oscEvent method. */
-void oscEvent(OscMessage theOscMessage) {
- /* with theOscMessage.isPlugged() you check if the osc message has already been
- * forwarded to a plugged method. if theOscMessage.isPlugged()==true, it has already
- * been forwared to another method in your sketch. theOscMessage.isPlugged() can
- * be used for double posting but is not required.
- */
- if(theOscMessage.isPlugged()==false) {
- /* print the address pattern and the typetag of the received OscMessage */
- println("### received an osc message.");
- println("### addrpattern\t"+theOscMessage.addrPattern());
- println("### typetag\t"+theOscMessage.typetag());
- theOscMessage.printData();
- }
-}
@@ -1,98 +0,0 @@
-import processing.serial.*;
-import cc.arduino.*;
-import TUIO.*;
-
-Arduino arduino;
-int servoPin = 9;
-
-TuioProcessing tuioClient;
-
-final static float tuioCursorSpeedMult = 0.02f; // the iphone screen is so small, easy to rack up huge velocities! need to scale down
-final static float tuioStationaryForce = 0.001; // force exerted when cursor is stationary
-
-boolean tuioDoubleTap = false;
-
-int xmap = 0; //holds tuio cursor x-movement
-
-
-void setup() {
- size(512, 200);
-
- arduino = new Arduino(this, Arduino.list()[0], 57600);
- //arduino.pinMode(servoPin, Arduino.OUTPUT);
-
- println("\n zeroing servo\n");
- arduino.analogWrite(servoPin, 90);
-
- // init TUIO
- tuioClient = new TuioProcessing(this);
-
-}
-
-public void servo( int x ){
- println("### plug event method. received a message /servo.");
- println(" servoWrite: "+x);
- arduino.analogWrite(servoPin, x);
-}
-
-void updateTUIO() {
- Vector tuioCursorList = tuioClient.getTuioCursors();
- //println("tuio found " + tuioCursorList.size() + "cursors");
- for (int i=0;i<tuioCursorList.size();i++) {
- TuioCursor tcur = (TuioCursor)tuioCursorList.elementAt(i);
- float vx = tcur.getXSpeed() * tuioCursorSpeedMult;
- float vy = tcur.getYSpeed() * tuioCursorSpeedMult;
- /* if(vx == 0 && vy == 0) {
- vx = random(-tuioStationaryForce, tuioStationaryForce);
- vy = random(-tuioStationaryForce, tuioStationaryForce);
- }
- addForce(tcur.getX(), tcur.getY(), vx, vy); */
- int xmap = round ( map( tcur.getX(), 0, 1, 30, 150 ) );
- println( xmap );
- arduino.analogWrite(servoPin, xmap );
- }
-}
-
-void draw() {
- updateTUIO();
-
- background(constrain(mouseX / 2, 0, 255));
-// arduino.analogWrite(servoPin, constrain(mouseX / 2, 0, 180));
-// arduino.analogWrite(11, constrain(255 - mouseX / 2, 0, 30));
-}
-
-void mousePressed() {
-
- println(" clicked: " + mouseX);
-
-}
-
-// TUIOLIB required methods
-
-
-void addTuioObject(TuioObject tobj) {
-}
-
-void updateTuioObject(TuioObject tobj) {
-}
-
-void removeTuioObject(TuioObject tobj) {
-}
-
-void addTuioCursor(TuioCursor tcur) {
- println("add cursor "+tcur.getCursorID()+" ("+tcur.getSessionID()+ ") " +tcur.getX()+" "+tcur.getY());
-}
-
-// called when a cursor is moved
-void updateTuioCursor (TuioCursor tcur) {
- //println("update cursor "+tcur.getCursorID()+" ("+tcur.getSessionID()+ ") " +tcur.getX()+" "+tcur.getY()" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel());
-}
-
-// called when a cursor is removed from the scene
-void removeTuioCursor(TuioCursor tcur) {
- //println("remove cursor "+tcur.getCursorID()+" ("+tcur.getSessionID()+")");
-}
-
-void refresh(TuioTime bundleTime) {
- redraw();
-}

0 comments on commit 5e0140d

Please sign in to comment.