Fixed issue where port A motor position was not being reported because the port number was false-y
This commit is contained in:
1 parent
4523597a04
commit
7d7ce2db13
1 file changed
+1
-1
@@ -1935,7 +1935,7 @@ class Scratch3BoostBlocks {
|
||||
log.warn('Asked for a motor position that doesnt exist!');
|
||||
return false;
|
||||
}
|
||||
if (portID && this._peripheral.motor(portID)) {
|
||||
if (portID !== null && this._peripheral.motor(portID)) {
|
||||
let val = this._peripheral.motor(portID).position;
|
||||
// Boost motor A position direction is reversed by design
|
||||
// so we have to reverse the position here
|
||||
|
||||
Reference in new issue
Block a user