Moving a line of code
This commit is contained in:
parent
997e8efb20
commit
223275fd65
@ -106,9 +106,9 @@ namespace sensors {
|
|||||||
//% weight=100 blockGap=8
|
//% weight=100 blockGap=8
|
||||||
//% group="Color Sensor"
|
//% group="Color Sensor"
|
||||||
onColorDetected(color: ColorSensorColor, handler: () => void) {
|
onColorDetected(color: ColorSensorColor, handler: () => void) {
|
||||||
|
this.setMode(ColorSensorMode.Color)
|
||||||
const v = this._colorEventValue(<number>color);
|
const v = this._colorEventValue(<number>color);
|
||||||
control.onEvent(this._id, v, handler);
|
control.onEvent(this._id, v, handler);
|
||||||
this.setMode(ColorSensorMode.Color)
|
|
||||||
if (this.color() == color)
|
if (this.color() == color)
|
||||||
control.raiseEvent(this._id, v);
|
control.raiseEvent(this._id, v);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user