src/networking/Communication.js
/*
   * Updates the sensor data, this data will be sent to the UI when
   * flushData is called.
   * @param x the x acceleration value of the sensor.
   * @param y the y acceleration value of the sensor.
   */
Updates the sensor data, this data will be sent to the UI when
flushData is called.
@param x the x acceleration value of the sensor.
@param y the y acceleration value of the sensor.
Updates the sensor data this data will be sent to the UI when flushData is called . @param x the x acceleration value of the sensor . @param y the y acceleration value of the sensor .
updateSensorData(x, y) {
    const beta = Math.round(y * 90);
    const gamma = Math.round(-x * 90);
    const oldBeta = this.dataBuffer.sensor.beta;
    const oldGamma = this.dataBuffer.sensor.gamma;
    if (beta !== oldBeta || gamma !== oldGamma) {
      this.dataBuffer.sensor = { beta, gamma };
      this.shouldFlushData = true;
    }
  }
updateSensorData ( x , y ) { const beta = Math . round ( y * 90 ) ; const gamma = Math . round ( - x * 90 ) ; const oldBeta = this . dataBuffer . sensor . beta ; const oldGamma = this . dataBuffer . sensor . gamma ; if ( beta !== oldBeta || gamma !== oldGamma ) { this . dataBuffer . sensor = { beta , gamma } ; this . shouldFlushData = true ; } }
Updates the sensor data, this data will be sent to the UI when
 flushData is called.
Updates the sensor data this data will be sent to the UI when flushData is called .