- Creating Boost._colorBucket will contains BoostColorSampleSize-amount of samples
- Boost._onMessage administers the _colorBucket and assigns Boost._sensors.color a value if all items in the bucket match.
E.g. if BoostColorSampleSize is set to 3, three continuous readings of the same color are required for the color to be detected by scratch-vm.
- Renamed BoostOutputCommandFeedback to BoostPortFeedback and its values for brevity
- Removed buf2hex-function
- Removed BoostMotor._pendingPositionOrigin (unused)
- Removed Boost._led (unused)
- Simplified _onMessage-handling of BoostPortFeedback-messages
- motorOnForRotation() now returns a Promise.all rather than a single promise. This solves two bugs:
-- when running turn ABCD for 3 rotations without motors connected to CD, the block would finish yielding immediately.
-- when running turn C for X rotations without a motor connected to C, the motor would never finish yielding.
- BoostMotor-class now has pendingPositionDestination, the rotation-equivalent of pendingTimeout, that stores a destination the motor should reach. When using setMotorPower() or setMotorDirection() while a motorOnForRotation()-block is running, a new motorOnForRotation()-command will be run for the remaining amount of degrees but with new power/direction, cancelling the old command.
- BoostMotor._status is only affected by feedback from the hub.
- setMotorPower() and setMotorDirection() no longer yields, since they just set state.
From design meeting regarding block design:
- Renamed all motors-label to ABCD.
- Added 'AB' motor label to address built-in motor pair.
- use the word direction in the setMotorDirection-block
- moved argument label in motor position reporter
- changed wording of color-sensing block.
- removed isTilted-boolean reporter
- removed changeLightHueBy-block
- fixed pingDevice-function bug.
-- Using a max-power setting of 100 rather than following the speed in the motor-commands will allow motors to run at really slow speeds.
-- As a result, motor-commands now use max-power of 100 regardless of speed and setMotorPower no longer scales according to a minimum speed of 20.
- BLE-rate enums consolidated into BoostBLE enum
Motors:
- motor position will now initially report 0 instead of false
- removed remaining motor position zeroing functions.
- removed startBraking().
- turnOn() and turnOnForDegrees() are now using an absolute max power as per the protocol documentation.
- the "turn for rotations"-block now accepts negative values.
-- turnOnForDegrees() accepts a direction to reflect the change above. The direction from the block is calculated against the motors current direction.
- commented EV3 tacho calculation code for motor positioning removed.
- Changed BoostMotorLabel to reflect actual motor block argument.
- startMotorPower() renamed to setMotorPower() since it doesn't start the motor.
- setMotorPower() will not start the motor.
- Max number of rotations for a motor-block is clamped to 100 rotations.
- 'Default' removed from BoostMotorLabel-enum as it wasn't used.
Sensors:
- removed remaining distance-related functions.
- color-reporters default value is now none rather than black.
- tilt-angles left and right switched to reflect the hubs orientation.
- Added BoostColorLabel-enum for color sensing block argument labels
- Regrouped blocks to be grouped by functionality, promoting color sensing
- Added 'any' to whenColor hat-block which triggers if the color sensor reports a value that is not none. Implemented an oldColor-value that allows the hat-block to trigger between color-changes, even if the sensor doesnt see 'none' in the meantime.