Search Unity

How to remove intermittent missed sensor data with Bluetooth LE asset

Discussion in 'Assets and Asset Store' started by NCartist, Jan 25, 2018.

  1. NCartist

    NCartist

    Joined:
    Nov 3, 2013
    Posts:
    15
    I'm am using the Bluetooth LE asset and am having issues with intermittent "0" values, or missed readings from the analogue sensors from my Arduino in Unity which are causing jittering of the object I'm controlling in Unity.

    The Arduino serial screen does not show any issues with "0" value readings, so I'm thinking it has to do with how Unity is handling the incoming data.

    Has anyone run across this issue? I have tried some data smoothing on the Arduino just to be sure, but that didn't help at all. I also tried using Fixedupdate in Unity, but that didn't help either.
     
  2. NCartist

    NCartist

    Joined:
    Nov 3, 2013
    Posts:
    15
    I decided to experiment more with the delay rate on the Arduino taking the readings and was able to get rid of all the jitter (ie. lost data) in Unity.

    When I reduced the delay from 100 to 10 on the Arduino, there was no more jitter. I tried lowering the delay to 5, but that made the ball (in Unity) not move at all.

    Maybe there just wasn't enough data to keep up with the frame rate and some of the frames were missing data from the device. Lower delay times on the Arduino do appear to significantly lower the frame rate, however.