void SendImageData(unsigned char * ImageData) { unsigned char i;
unsigned char crc = 0; /* Send Data */
uart_putchar(UART0,'*');
uart_putchar(UART0,'L');
uart_putchar(UART0,'D'); SendHex(0);
SendHex(0);
SendHex(0);
SendHex(0);
Pixel=*ImageData;
unsigned char DIRECTION_ADTHRESHOLD=0x3d;
for(i=0;i<128;i++) //定义128个点
{
if(Pixel<DIRECTION_ADTHRESHOLD) //自己定义的阀值,AD后的中间值
{
Pixel=0;//128个点的数组
}
else
{
Pixel=1;
}
}
uart_putchar(UART0,Pixel);
SendHex(crc);
uart_putchar(UART0,'#');
} 在哪添加,为何在这不行? |