Programming error help

Can anyone help me with the error that I keep getting below? It only does it when I have processing use my USB camera.

 

 

 

 

2008-11-06 15:45:56.095 java[10117:18503] Found image sensor of class:MyHDCS1000Sensor, camera of class:MyQCExpressADriver

 

2008-11-06 15:47:47.965 java[10117:18503] *** -[NSLock lock]: deadlock (<NSLock: 0x1c116f10> ‘(null)’)

2008-11-06 15:47:47.966 java[10117:18503] *** Break on _NSLockError() to debug.

2008-11-06 15:47:48.069 java[10117:1a203] *** -[NSLock unlock]: lock (<NSLock: 0x1c116f10> ‘(null)’) unlocked from thread which did not lock it

2008-11-06 15:47:48.070 java[10117:1a203] *** Break on _NSLockError() to debug.

Free Fall Elevator

So yeah, wasn’t really supposed to be the free fall elevator, but thats what it became. My very original idea was to make a catapult, and the point of the arduino was to note that a load was present, make the motor pull back the arm, check that there was still a load, and release the arm to fire. I also wanted to try and map the amount of pull to a distance of load travel, so that the user could tell it how far to launch something. Where did I go wrong?

Basically, the motors weren’t strong enough to pull against almost any of my springs. So idea gets re-designed.

So next I decided to make an elevator, where the user could tell the elevator to go to a specific floor, and the elevator would respond accordingly. There would be levels of state and response. For example, if you told the elevator to go to its current floor, it would ding and light up that floor’s LED. If you told it to go to another floor, it would light up the new floor’s LED and say whether it was going up or down. Since it knew where it was, it knew how far to go, whether it was going up/down one/two floors. Where did I go wrong?

Basically, it took me way too long to get to this idea, and I had a major malfunction during the night that brought the project to a halt. When this happened, I had built the elevator, and had made the elevator motors capable of both forward and reverse. Then I had just programmed the up and down buttons when my computer crapped out.

Below are some photos and the code. Obviously the code isn’t the final product, but what I had when I had to stop.

 

Here is my code:
 
int motorPinA = 8;                // LED connected to digital pin 13
int motorPinC = 9;
int motorPinB = 10;
int motorPinD = 11;
int signalPinUp = 3;
int signalPinDown = 2;
int valUp = HIGH;
int valDown = HIGH;

 
void setup()                    // run once, when the sketch starts
{
  pinMode(motorPinA, OUTPUT);      // sets the digital pin as output
  pinMode(motorPinB, OUTPUT);
  pinMode(motorPinC, OUTPUT);
  pinMode(motorPinD, OUTPUT);
  pinMode(signalPinUp, INPUT);
  pinMode(signalPinDown, INPUT);
  //Serial.begin(9600);
 
}
 
void runUp() {
  digitalWrite(motorPinA, HIGH);   // sets motor to forward
  digitalWrite(motorPinB, LOW);
  digitalWrite(motorPinC, LOW);
  digitalWrite(motorPinD, HIGH);
}
 
void runDown() {
  digitalWrite(motorPinA, LOW); 
  digitalWrite(motorPinB, HIGH);
  digitalWrite(motorPinC, HIGH);
  digitalWrite(motorPinD, LOW);  
}
 
 
void loop()                     // run over and over again
{
  valUp = digitalRead(signalPinUp);  // read input value
  valDown = digitalRead(signalPinDown);
  //Serial.println(val);
  if (valUp == HIGH && valDown == HIGH) {
  digitalWrite(motorPinA, LOW);    // sets motor to reverse
  digitalWrite(motorPinB, LOW);
  digitalWrite(motorPinC, LOW);
  digitalWrite(motorPinD, LOW);    
  }
  
  if (valUp == LOW) {
    runUp();
    valUp = HIGH;
    valDown = HIGH;  
  }
  if (valDown == LOW) {
    runDown();
    valUp = HIGH;
    valDown = HIGH;
  }
}

Hat Detector

So my interactive clothing was a hat to alert you of someone/something getting close to you. The sensor was a little small so things had to get pretty close to trigger it. When the trigger gets set too close, the light starts to blink for 10 seconds and then resets. This was originally set with three sensors to get back, left, and right, but I couldn’t get to the sensors in time, so it was only one sensor. I tried to make the bread board and arduino pack as small as possible on this project, but I need to work on better and faster connections. 

Code:

 

/*
 * HAT DETECTOR
 */
int disPin1 = 0;    // select the input pin for the distance finder
int ledPin1 = 9;   // select the pin for the LED
int disVal1 = 0;       // variable to store the value coming from the sensor
int tooClose = 0;
int count = 0;
void setup() {
  pinMode(ledPin1, OUTPUT);  // declare the ledPin as an OUTPUT
}
void loop() {
  if(tooClose = 0) {
    disVal1 = analogRead(disPin1);    // read the value from the sensor
    if(disVal1 < 50) {                //Turn off LED for low/no activity
       digitalWrite(ledPin1, LOW);
    }
    if(disVal1 > 50 && disVal1 < 550) {
       digitalWrite(ledPin1, map(disVal1, 0, 600, 0, 255));
    }
    if(disVal1 >= 550) {              //Set tooClose value
      tooClose = 1;
    }
  else {                              //Set LED to flash when too close.
       digitalWrite(ledPin1, 600);
       delay(250);
       digitalWrite(ledPin1, LOW);
       delay(250);
       count++;
       if(count = 10) {
         count = 0;
         tooClose = 0;
       }
  }
}

Change Detector

Concept: Change Detector

Description:

So my design was to alert you that you have change in your pocket. I was able to use a pair of shorts that had baggy pockets. I was able to store the arduino and power in the lower side pockets, and then run the wires into my pocket. Getting these connectors to not touch in everyday use was hard, but I was able to make it mostly successful by placing them at different elevations. In this case though, it often took multiple coins to trigger the detector. I then placed an LED in the lower pocket that lit up when the coin completed the circuit.

Circuit:

My circuit is much like the button circuit and the button code, except some of the pins are changed in the code and the wires are adjusted to allow for enough room. I used aluminum foil on the ends of the wires to make the connections in my pocket.

 

Images: