Go Down

Topic: Basic Stamp CMU cam with arduino? (Read 852 times) previous topic - next topic

hscriber

Apr 07, 2011, 11:54 pm Last Edit: Apr 08, 2011, 12:49 am by hscriber Reason: 1
Is it possible to incorporate the CMU cam made to use with the Boe Bot Basic Stamp on the Arduino?  And if so, does anyone have a sample sketch?  I'm doing a project for a class, and I checked out a CMU cam but all the instructions that came with it are for the Basic Stamp language, and I have no clue where to begin.  Just so you know how I want to use it, I want the CMU cam to be able to distinguish a golf ball from its surroundings.  Or in other words, see white against green grass or a dark floor.  Please help.

johnwasser

It looks like the protocol is 9600 baud ascii over TTL Serial so you should be able to use it from an Arduino.

Read the manual: http://www.parallax.com/Portals/0/Downloads/docs/prod/robo/CMUcam%20Manual.PDF

I don't know if it can track something small and white like a golfball.

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

hscriber

I have the manual, and it makes no sense to me.  I do not understand the Basic Stamp language, I barely understand the arduino language.  When I say I have no clue where to begin, I mean no clue what so ever.  A sample sketch from someone that has used it incorporated with the arduino would be great, and a wiring diagram or even and actual picture of one wired up would be awesome.  If I mess the camera up from bad wiring, I have to replace it, so I'd rather not do that.  Thanks.

johnwasser

The interface is fairly straightforward.  You send a short command line and get a line or series of lines in reply.  The lines end in a Return ('\r') character.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

hscriber

Again, no clue what you're talking about. I've never seen that return symbol your talking about. You sure thats with the arduino? I have not the newest arduino, but the one right before it. It uses a style of c++.

hscriber

Here's a sample of my code, so you know what I'm looking at.  It measures distance with a PING))) sensor and then writes it to an LCD screen:
Code: [Select]

void setup(){
  Serial.begin(9600);
  Serial.print(12, BYTE);
  Serial.print(128, BYTE);
  Serial.print("Distance="); 
}
void loop(){
  int tone_freq=0;
  long duration, inches;
  pinMode(3, OUTPUT);
  digitalWrite(3, LOW);
  delayMicroseconds(2);
  digitalWrite(3, HIGH);
  delayMicroseconds(5);
  digitalWrite(3, LOW);
  pinMode(3, INPUT);
  duration = pulseIn(3, HIGH);
  Serial.print(148, BYTE);
  Serial.print(duration);
  inches = (duration/2)/74;
  Serial.print(137, BYTE);
  Serial.print(inches);
  delay(100);
  tone_freq= inches*100;
  tone(2,tone_freq);
}

AWOL

Now it's our turn to not have a clue what you're talking about - what has Ping got to do with CMUcam?

\r is a standard C representation of carriage-return.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

hscriber

Nothing, that's just an example of the language I'm using in case it's different from previous Arduinos.

AWOL

Quote
I barely understand the arduino language

If you go to file/examples in the IDE, you'll find lots of ways of learning.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up