mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
commit
25b516a406
1 changed files with 9 additions and 1 deletions
|
@ -501,7 +501,14 @@ class WeDo2 {
|
||||||
*/
|
*/
|
||||||
// TODO: rename disconnect?
|
// TODO: rename disconnect?
|
||||||
disconnectSession () {
|
disconnectSession () {
|
||||||
// window.clearInterval(this._timeoutID);
|
this._ports = ['none', 'none'];
|
||||||
|
this._motors = [null, null];
|
||||||
|
this._sensors = {
|
||||||
|
tiltX: 0,
|
||||||
|
tiltY: 0,
|
||||||
|
distance: 0
|
||||||
|
};
|
||||||
|
|
||||||
this._ble.disconnectSession();
|
this._ble.disconnectSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -691,6 +698,7 @@ class WeDo2 {
|
||||||
* Stop the tone playing and motors on the WeDo 2.0 hub.
|
* Stop the tone playing and motors on the WeDo 2.0 hub.
|
||||||
*/
|
*/
|
||||||
_stopAll () {
|
_stopAll () {
|
||||||
|
if (!this.getPeripheralIsConnected()) return;
|
||||||
this.stopTone()
|
this.stopTone()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.stopAllMotors();
|
this.stopAllMotors();
|
||||||
|
|
Loading…
Reference in a new issue