【正文】
*/ unsigned char abs_sub(unsigned char num1, unsigned char num2) { unsigned char difference。 while(SCI0SR1_TDRE!=1)。 return sci_data。 while(SCI0SR1_RDRF!=1)。 short FuzzyLogic(short stand)。 unsigned char curve 。 // current speed short stand。 // used to save data in PA process Unsigned char counter。 // temperary variable used in data transfer unsigned char sample_data[LINE_MAX] 。 // used to counter in AD unsigned char row_image 。 // yposition of the array unsigned int row_count 。 // 0nedimensional array unsigned char row 。 include /* mon defines and macros */ include /* derivative information */ pragma LINK_INFO DERIVATIVE mc9s12db128b include include // variable used in video process volatile unsigned char image_data[ROW_MAX][LINE_MAX] 。比如程序里用 PT0,硬件上用 PT1,當(dāng)然不能達(dá)到預(yù)期效果。 光有程序沒有多大用。要看軟件和硬件結(jié)合起來才行。下面是上海交通大學(xué)的程序。 // data array of picture unsigned char black_x[ROW_MAX] 。 // xposition of the array unsigned char line 。 // row counter unsigned char line_sample 。 unsigned char line_temp 。 // used to save onedimension array got in interruption // variables below are used in speed measure Unsigned char pulse[5