Add clearing of values on disconnect.

This commit is contained in:
Evelyn Eastmond 2019-02-04 19:43:50 -05:00
parent 93aecc88be
commit e87dd01629

View file

@ -167,6 +167,15 @@ class GdxFor {
* Disconnect from the GDX FOR.
*/
disconnect () {
this._sensors = {
force: 0,
accelerationX: 0,
accelerationY: 0,
accelerationZ: 0,
spinSpeedX: 0,
spinSpeedY: 0,
spinSpeedZ: 0
};
if (this._scratchLinkSocket) {
this._scratchLinkSocket.disconnect();
}