CMU 2 cam with Vex

Hi, one of my mentors wants me to hook up a CMU cam to a vex robot. But I’m not sure how to hook up power to it? Has anyone ever done this? Should I just hook a PWM cable from the camera to the vex controller?

Thanks for the help,
Nathan

Try this thread :slight_smile:

Wow, thanks. Exactly what I needed!

I made that work a couple months ago. I used Kevin’s camera code moved to a vex MPLab project.

Where could I find Kevin’s code? That would really help alot!

Thanks,
Nathan

www.kevin.org/frc

If you want any other help PM or e-mail me Haskinseric@hotmail.com.

EDIT: I tested my vex with the code in frc_camera_s.zip. It may work with version 2 and/or the full version of the code, but I know the first simple version works.

You will need to follow the instructions in the readme to move the code to an EDU/Vex robot. I know it says its for the EDU only, but the process to move it to a VEX is the same.

Also I was using the Radio Shack programming kit, but using MPLab IDE and IFI Loader. This will work with MPLab, but I don’t think its possible with EasyC, because you wont have access to the serial ports.

Sorry for the long edit, but I thought of alot after I typed the my response.

Again, if you want any other help PM or e-mail me :smiley: Haskinseric@hotmail.com.

EDIT Again: If you need a copy of the MPLab default code for a vex you can download it from http://www.vexlabs.com/vex-robotics-downloads.shtml. Here is a direct link to the file http://www.vexlabs.com/docs/vex-startup-code.zip. You can also get IFI loader from that page.

Hope this helps,

Thanks! And I already use MPlab so that shouldn’t be a problem. By “the first simple version” do you mean frc_camera.zip?

Thanks again,
Nathan

I used frc_camera_s.zip.

frc_camera_s.zip

EDIT: You do need a different version of the default code for a vex. The code from an FRC controller will NOT work. You can download it from the link in my post above.

Eric’s been helping me via e-mail (Thanks Eric!), and now I’ve gotten the cables all hooked up. But when I try to integrate Kevin’s camera code, by adding “camera.c” and “camera.h” to my MPlab project, I get the following error:

Error - could not find definition of symbol ‘Serial_Port_Two_Byte_Count’ in file ‘C:\VexCode\camera.o’.
Errors : 1

BUILD FAILED: Sat Nov 11 12:53:45 2006

And unfortunately I can’t get it to go away… Any idea’s why I’m getting this?

Thanks,
Nathan

That’s defined in Kevin’s serial_ports.c/h files.

Did you include those in your project?

No, I didn’t. I guess that was the problem, thanks :slight_smile: Now, do I need to include the rest of the Kevin’s .c/.h files to my project, or will just having the camera.c/h and serial_ports.c/h files be ok?

If you follow the instrustions in the Camera Readme, tracking readme, and the serial port readme. Your robot should be working in no time. :smiley:

If you are planning to write your own tracking code you don’t need to follow the tracking readme to integrate tracking.c/.h/

Thanks. And I’ve been trying to read all the readme’s/.c/.h files, and is this how you track an object:

Initialize_Camera();
Camera_Idle();
Track_Color();

Is that how you do it?

Thanks,
Nathan

If you have integrated the serial and camera code properly you can put this code in porcess_data_from_master_up


Camera_Handler();// this  updates the camera data.
Servo_Track();// this is in tracking.c, so you must include tracking.h.

You can look at the code in kevin’s frc code, or the code I e-mailed you for a better explaination.

Feel free to e-mail me. :smiley: