0

Hello all,
I have a CMUCAM 2 camera. I communicate with this camera through the serial port. The camera sends the data in non visible ascii format... My question what type of format should i use in scanf command. or is there any other way to read such format?
Thank you

2
Contributors
1
Reply
3
Views
10 Years
Discussion Span
Last Post by Salem
0

Then it's just a stream of bytes (eg. unsigned chars).

So you read it using whatever OS/Compiler specific functions you have for reading the serial port, and store those bytes in some kind of array (or some C++ equivalent if that's where you're going).

After that, you pretty much have to examine each byte in turn to figure out what it means, and what to do next.
Eg.

if ( buff[0] == 0x01 ) {
  // start of a frame, the next two bytes are the length of the image data 
  // which follows.
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.