![]() |
C code to get information from CMUcam2
Hello everybody
I am using CMUcam2 that is installed on a robot that uses an Altera Board. The camera is connecting to the board using a UART port. I am using Altera NIOS II IDE environment to do the C language to test and run the C code that communicates with the camera. So it is a C code that runs on the Altera board. Can anybody help me to know what's the basci C code that communicates with the camera. I need to get color and light information from the camera. Any help will be apreciated.:) |
Re: C code to get information from CMUcam2
|
Re: C code to get information from CMUcam2
Hello and welcome to Chief Delphi. It sounds like you're using a different system than we all use in our competition, but it's likely that some people around here will still be able to help you.
If you use the documentation that Max linked to, you should be able to figure out a lot about the CMUcam2 protocol. From the work I've done with it, it's pretty simple. Send a few bytes out your UART, terminate it with a carriage return, and you'll get back an ACK and/or the data you requested. All of the commands are documented in the CMUcam2 manual, and on Kevin Watson's site. As for the actual code to read and write to your UART, that's beyond the scope of my knowledge. Somebody else around here may know, or you can poke around on Google. Once you've got that figured out, the CMUcam2 interface is pretty simple. (As somewhat of a side note, you can play around with the commands and see what they do by plugging the CMUcam2 into your computer, and then using a program like Hyperterminal to send and receive the data.) |
Re: C code to get information from CMUcam2
Thanks for your reply
But what do you think about this code, any notes please. Code:
/* A simple program that sends an order to the CMUcam2 camera and |
Re: C code to get information from CMUcam2
Written_Char = fputc(":TC\r",fp);
i think you want to take the : out of that.. you see a : before all the lines in the manual just because thats how hyperterm prompt is... take out the : and try that |
Re: C code to get information from CMUcam2
That works fairly well - it looks like you're using a UNIX-based system. I believe you'd be better off using the read/write syscalls for the UART interface on your device, i.e.:
Code:
#include <stdio.h> |
| All times are GMT -5. The time now is 00:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi