Moving a line of code

This commit is contained in:
Caitlin Hennessy 2017-12-13 13:35:28 -08:00
parent 997e8efb20
commit 223275fd65

View File

@ -106,9 +106,9 @@ namespace sensors {
//% weight=100 blockGap=8
//% group="Color Sensor"
onColorDetected(color: ColorSensorColor, handler: () => void) {
this.setMode(ColorSensorMode.Color)
const v = this._colorEventValue(<number>color);
control.onEvent(this._id, v, handler);
this.setMode(ColorSensorMode.Color)
if (this.color() == color)
control.raiseEvent(this._id, v);
}