From f4e9212249cde2daab510350135ec9dd20b6e141 Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Tue, 21 Aug 2018 11:18:58 -0400 Subject: [PATCH] Fixing #1504: WeDo2: Distance sensor not being cleared on device disconnect. --- src/extensions/scratch3_wedo2/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/extensions/scratch3_wedo2/index.js b/src/extensions/scratch3_wedo2/index.js index 03d0d0e61..a158269e5 100644 --- a/src/extensions/scratch3_wedo2/index.js +++ b/src/extensions/scratch3_wedo2/index.js @@ -479,7 +479,14 @@ class WeDo2 { */ // TODO: rename disconnect? disconnectSession () { - // window.clearInterval(this._timeoutID); + this._ports = ['none', 'none']; + this._motors = [null, null]; + this._sensors = { + tiltX: 0, + tiltY: 0, + distance: 0 + }; + this._ble.disconnectSession(); }