大家好!我一直被这个问题困扰着,希望你们给点提示。谢谢!代码如下:
printp(uart_putchar,"%d",0x00);
printp(uart_putchar,"%d",0xFF);
printp(uart_putchar,"%d",0x01);
printp(uart_putchar,"%d",0x00);
for(i=0;i<IMAGE_ROW-IMAGE_ROW_DIS;i++) //20
{
pucTemp1=puca_BufferProcess+(i)*IMAGE_COLUMN;
for(j=0;j<IMAGE_COLUMN; j++ )
{
printp(uart_putchar,"%d",*(pucTemp1+j)); //发送图像的AD值
}
printp(uart_putchar,"\n");
上位机格式为:
比如说你的图像尺寸为80X30,VideoData[VIDEO_HEIGHT][VIDEO_WIDTH]为二维数组存放图像,SCI0SendByte(c)为发送c到串口的函数,则程序如下: #define VIDEO_WIDTH 80 #define VIDEO_HEIGHT 30 //发送命令字 SCI0SendByte(0x00); SCI0SendByte(0xFF); SCI0SendByte(0x01); SCI0SendByte(0x00); //发送图像数据 for(i=0;i<VIDEO_HEIGHT;i++){ for(j=0;j<VIDEO_WIDTH;j++){ SCI0SendByte(VideoData[j]); } }
|