void sendString(char* s ) { while (*s) { OSSendRS232( s, SERIAL1); s++; } } /* Get and send big colour image in binary format to PC over RS232 Do $ stty -F/dev/ttyS0 115200 (only necesarry the for first image and maybe not even then) $ cat /dev/ttyS0 >bild.ppm on PC before sending. Press ctrl-c when image has been sent. view with $ gimp bild.ppm & or (maybe more convieniently) with $ display bild.ppm & */ void getAndSendBigRGBData() { typedef BYTE bigcolimage[144][176][3]; bigcolimage img; int i,j; char temp[100]; CAMGetFrameRGB((BYTE *)img); OSInitRS232( SER115200, NONE, SERIAL1 ); sprintf(temp, "P6\n" "176 144\n" "255\n"); sendString(temp); for(i=0, j=0; i < 144*176; i++, j+=3) { BYTE r,g,b; r=((BYTE *)img)[j]; g=((BYTE *)img)[j+1]; b=((BYTE *)img)[j+2]; temp [0]=r;temp [1]=g;temp [2]=b;temp [3]=0; if ((i&0x3ff) == 0) { LCDClear(); LCDPrintf(" %4d of %4d\n", i, 144*176 ); } sendString(temp); } }