The sensor has no memory. Nothing you have done before will affect the next range. So, if you are getting a time lag it's because the data you have in a serial buffer is not getting plotted on your PC in a timely manner.
Python is notorious for this. Your PC is just not sucking the data up as fast as it's being input, and the PC serial buffer is huge. Python is pretty impressive, but no one said it was fast.
Try pySerial Flush. Might fix you right up.
So what happens with black tape?
If you do a sloppy job of taping and a few photons can hit the tape and return, you will get a very low signal rate and a distance very near zero.
if you do a great job, then no photons come back and you get a 'low signal' RangeStatus.
But you will also get an extremely low ambient count so you might be able to tell you have a tape situation.
Try putting a coverglass over the sensor and then put the tape over the glass.
that way you will get a lot of photons back - and you can tell it's tape.
- john
If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.