Reading serial port in Java

前端 未结 3 1916
情歌与酒
情歌与酒 2020-12-06 02:36

I\'m beginner in Java. I\'m reading data from device through serial port. I\'m getting data for every one minute, but first reading is coming half, after that data is coming

3条回答
  •  猫巷女王i
    2020-12-06 03:07

    This looks as if you were reading the rest of some message which was sent before you started.

    Try to read as much data as possible as you start the program to clear any hardware buffers. After that, start your processing.

提交回复
热议问题