View Single Post
  #4   Spotlight this post!  
Unread 01-03-2007, 15:23
lrantisi lrantisi is offline
Registered User
no team
 
Join Date: Feb 2007
Location: Canada
Posts: 2
lrantisi is an unknown quantity at this point
Wink 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
 reads back from it*/
:confused: :rolleyes: :] 
#include <stdio.h>
#include <string.h>
int main ()
{
FILE* fp;
char prompt = 0;
int Written_Char;

fp = fopen ("/dev/uart1", "r+"); //Open the camera port for reading and writing.
if (fp)
{
Written_Char = fputc(":TC\r",fp); // writing a character to the UART.
prompt = getc(fp); // Get a character from the UART.
fprintf(fp, "Closing the UART file.\n");
fclose (fp);
}
return 0;
}