READ一下就完成啦。
void hcsr04_read()
{
// if(TIM3CH1_CAPTURE_STA & 0x80) //
// {
// time = TIM3CH1_CAPTURE_STA & 0x3F; //
// time *= 65536; //
// time += TIM3CH1_CAPTURE_VAL; //
// distance = time * 342.62*100/2000000;
// LCD_ShowxNum(20, 250, distance, 20, 16, 0);
// TIM3CH1_CAPTURE_STA = 0;
// }
distance[1] = (uint16_t)((scr04_count[1] * 342.62 * 100.0)/2000000.0);
// LCD_ShowString(0, 235, 20, 20, 16, "ONE");
// LCD_ShowxNum(40, 235, distance[1], 6, 16, 0);
distance[2] = (uint16_t)((scr04_count[2] * 342.62 * 100.0)/2000000.0);
// LCD_ShowString(0, 255, 20, 20, 16, "TWO");
// LCD_ShowxNum(40, 255, distance[2], 6, 16, 0);
distance[3] = (uint16_t)((scr04_count[3] * 342.62 * 100.0)/2000000.0);
// LCD_ShowString(0, 275, 20, 20, 16, "TRE");
// LCD_ShowxNum(40, 275, distance[3], 6, 16, 0);
distance[4] = (uint16_t)((scr04_count[4] * 342.62 * 100.0)/2000000.0);
// LCD_ShowString(0, 295, 20, 20, 16, "FOU");
// LCD_ShowxNum(40, 295, distance[4], 6, 16, 0);
}