Pages: [1]   Go Down
Author Topic: Basic Stamp CMU cam with arduino?  (Read 840 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 07, 2011, 05:49:53 pm by hscriber » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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++.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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);
}
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26634
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26634
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I barely understand the arduino language
If you go to file/examples in the IDE, you'll find lots of ways of learning.
Logged

"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.

Pages: [1]   Go Up
Jump to: