diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index dc295dca..5a489751 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -99,9 +99,9 @@ * [set remote channel](/reference/sensors/beacon/set-remote-channel) * [Color](/reference/sensors/color-sensor) * [on color detected](/reference/sensors/color-sensor/on-color-detected) - * [pause for color](/reference/sensors/color-sensor/pause-for-color) - * [on light changed](/reference/sensors/color-sensor/on-light-changed) - * [pause for light](/reference/sensors/color-sensor/pause-for-light) + * [pause until color detected](/reference/sensors/color-sensor/pause-until-color-detected) + * [on-light-condition-detected](/reference/sensors/color-sensor/on-light-condition-detected) + * [pause until light condition detected](/reference/sensors/color-sensor/pause-until-light-condition-detected) * [color](/reference/sensors/color-sensor/color) * [light](/reference/sensors/color-sensor/ambient-light) * [Music](/reference/music) diff --git a/docs/coding/light-the-way-1.md b/docs/coding/light-the-way-1.md index 19a67e48..c1a0399a 100644 --- a/docs/coding/light-the-way-1.md +++ b/docs/coding/light-the-way-1.md @@ -1,7 +1,7 @@ # Light the way Activity 1 ```blocks -sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Dark, function () { brick.showImage(images.objectsLightOn) pause(5000) brick.clearScreen() diff --git a/docs/coding/light-the-way-2.md b/docs/coding/light-the-way-2.md index 478c8e6d..64665ed9 100644 --- a/docs/coding/light-the-way-2.md +++ b/docs/coding/light-the-way-2.md @@ -1,10 +1,10 @@ # Light the way Activity 2 ```blocks -sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Bright, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Bright, function () { brick.clearScreen() }) -sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Dark, function () { brick.showImage(images.objectsLightOn) }) ``` \ No newline at end of file diff --git a/docs/coding/light-the-way-3.md b/docs/coding/light-the-way-3.md index d2aa3798..c800e7f4 100644 --- a/docs/coding/light-the-way-3.md +++ b/docs/coding/light-the-way-3.md @@ -1,10 +1,10 @@ # Light the way Activity 3 ```blocks -sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Bright, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Bright, function () { brick.clearScreen() }) -sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Dark, function () { brick.showImage(images.objectsLightOn) }) sensors.touch1.onEvent(ButtonEvent.Pressed, function () { diff --git a/docs/coding/line-detection.md b/docs/coding/line-detection.md index 238abff7..87dee3ef 100644 --- a/docs/coding/line-detection.md +++ b/docs/coding/line-detection.md @@ -54,7 +54,7 @@ loops.forever(function () { }) motors.largeBC.steer(0, 50) -sensors.color3.pauseForColor(ColorSensorColor.Red) +sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() ``` @@ -70,7 +70,7 @@ motors.stopAll() ```blocks loops.forever(function () { motors.largeBC.steer(0, 50) - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() }) ``` @@ -94,9 +94,9 @@ Now add to your program and have your robot to drive forward again when the ligh ```blocks loops.forever(function () { motors.largeBC.steer(0, 50) - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() - sensors.color3.pauseForColor(ColorSensorColor.Green) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Green) }) ``` @@ -134,10 +134,10 @@ music.playSoundEffect(sounds.systemGeneralAlert) ```blocks loops.forever(function () { motors.largeBC.steer(-30, 20) - sensors.color3.pauseForColor(ColorSensorColor.Black) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Black) music.playSoundEffect(sounds.systemGeneralAlert) motors.largeBC.steer(30, 20) - sensors.color3.pauseForColor(ColorSensorColor.White) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.White) }) ``` @@ -185,11 +185,11 @@ if (true) { ```blocks forever(function () { while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Black) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Black) motors.largeBC.steer(-30, 50) } while (true) { - sensors.color3.pauseForColor(ColorSensorColor.White) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.White) motors.largeBC.steer(30, 50) } }) @@ -204,10 +204,10 @@ Else the Color Sensor detects the color white, start motors ``B`` and ``C`` (dri ```blocks forever(function () { if (true) { - sensors.color3.pauseForColor(ColorSensorColor.Black) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Black) motors.largeBC.steer(-30, 50) } else { - sensors.color3.pauseForColor(ColorSensorColor.White) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.White) motors.largeBC.steer(30, 50) } }) diff --git a/docs/coding/traffic-lights-1.md b/docs/coding/traffic-lights-1.md index ffcfc3a1..1127488d 100644 --- a/docs/coding/traffic-lights-1.md +++ b/docs/coding/traffic-lights-1.md @@ -3,7 +3,7 @@ ```blocks brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () { motors.largeBC.tank(20, 20) - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.largeBC.tank(0, 0) }) ``` \ No newline at end of file diff --git a/docs/getting-started/try.md b/docs/getting-started/try.md index 300d8e18..6d236875 100644 --- a/docs/getting-started/try.md +++ b/docs/getting-started/try.md @@ -135,7 +135,7 @@ Keeping the Large Motor connected to **Port D**, connect the Color Sensor to **P ```blocks brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { - sensors.color3.pauseForColor(ColorSensorColor.Green) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Green) motors.largeD.run(50, 1, MoveUnit.Rotations) }) ``` @@ -143,7 +143,7 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { * Using the same program, replace the ``||sensors:pause until touch 1||`` block with a ``||sensors:pause color sensor 3||`` for color block. ```block -sensors.color3.pauseForColor(ColorSensorColor.Green) +sensors.color3.pauseUntilColorDetected(ColorSensorColor.Green) ``` * Select the color you want to detect (e.g., green). diff --git a/docs/lessons/line-detection.md b/docs/lessons/line-detection.md index 1ad526cc..6d2d1d9d 100644 --- a/docs/lessons/line-detection.md +++ b/docs/lessons/line-detection.md @@ -60,18 +60,18 @@ while (true) { ### Step 3 -Place a ``||sensors:pause for color||`` from ``||sensors:Sensors||`` inside the ``||loops:while||`` loop block. Change the color to red. +Place a ``||sensors:pause until color detected||`` from ``||sensors:Sensors||`` inside the ``||loops:while||`` loop block. Change the color to red. ```blocks motors.largeBC.steer(0, 20) while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) } ``` ### Step 4 -Place a ``||motors:stop all motors||`` block under the ``||sensors:pause for color||`` block. +Place a ``||motors:stop all motors||`` block under the ``||sensors:pause until color detected||`` block. Study the program...what do you think the program will do? @@ -80,7 +80,7 @@ Study the program...what do you think the program will do? ```blocks motors.largeBC.steer(0, 20) while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() } ``` @@ -128,26 +128,26 @@ while (true) { ### Step 5 -Place a ``||sensors:pause for color||`` block from ``||sensors:Sensors||`` inside the ``||loops:while||`` loop block. Change the color to red. +Place a ``||sensors:pause until color detected||`` block from ``||sensors:Sensors||`` inside the ``||loops:while||`` loop block. Change the color to red. ```blocks while (true) { motors.largeBC.steer(0, 20) while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) } } ``` ### Step 6 -Place a ``||motors:stop all motors||`` block under the ``||sensors:pause for color||`` block. +Place a ``||motors:stop all motors||`` block under the ``||sensors:pause until color detected||`` block. ```blocks while (true) { motors.largeBC.steer(0, 20) while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() } } @@ -161,7 +161,7 @@ Place a ``||loops:while||`` loop block under the second ``||loops:while||`` loop while (true) { motors.largeBC.steer(0, 20) while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() } while (true) { @@ -172,7 +172,7 @@ while (true) { ### Step 8 -Place a ``||sensors:pause for color||`` block inside the new ``||loops:while||`` loop block. Change the color to red. +Place a ``||sensors:pause unril color detected||`` block inside the new ``||loops:while||`` loop block. Change the color to red. What do you think the program will do? @@ -182,11 +182,11 @@ What do you think the program will do? while (true) { motors.largeBC.steer(0, 20) while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) motors.stopAll() } while (true) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) } } ``` @@ -208,16 +208,17 @@ Think about what you have learned, then document it. Describe your pseudocode fo ```blocks motors.largeBC.steer(0, 20) while (true) { -sensors.color3.pauseForColor(ColorSensorColor.Yellow) +sensors.color3.pauseUntilColorDetected(ColorSensorColor.Yellow) music.playSoundEffect(sounds.systemGeneralAlert) } while (true) { - while (true) { sensors.color3.pauseForLight(LightIntensityMode.Reflected, LightCondition.Bright) + while (true) { + sensors.color3.pauseUntilLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Bright) motors.largeB.run(10) motors.largeC.run(-10) } while (true) { - sensors.color3.pauseForLight(LightIntensityMode.Reflected, LightCondition.Bright) + sensors.color3.pauseUntilLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Bright) motors.largeA.run(-10) motors.largeA.run(10) } @@ -234,12 +235,13 @@ You will need to constantly debug your program in order to make your robot trave ```blocks while (true) { - while (true) { sensors.color3.pauseForLight(LightIntensityMode.Reflected, LightCondition.Bright) + while (true) { + sensors.color3.pauseUntilLightDetected(LightIntensityMode.Reflected, LightCondition.Bright) motors.largeB.run(10) motors.largeC.run(-10) } while (true) { - sensors.color3.pauseForLight(LightIntensityMode.Reflected, LightCondition.Bright) + sensors.color3.pauseUntilLightDetected(LightIntensityMode.Reflected, LightCondition.Bright) motors.largeB.run(-10) motors.largeC.run(10) } diff --git a/docs/maker/sound-machine.md b/docs/maker/sound-machine.md index 73d6a378..a0784edf 100644 --- a/docs/maker/sound-machine.md +++ b/docs/maker/sound-machine.md @@ -143,13 +143,13 @@ You can also tinker with the use of sensors. ```blocks forever(function () { if (true) { - sensors.color3.pauseForColor(ColorSensorColor.Blue) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Blue) music.playTone(392, music.beat(BeatFraction.Whole)) } else if (false) { - sensors.color3.pauseForColor(ColorSensorColor.Red) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Red) music.playTone(523, music.beat(BeatFraction.Half)) } else { - sensors.color3.pauseForColor(ColorSensorColor.Green) + sensors.color3.pauseUntilColorDetected(ColorSensorColor.Green) music.playTone(587, music.beat(BeatFraction.Half)) } }) diff --git a/docs/reference/sensors.md b/docs/reference/sensors.md index ae03d914..ce3d3da8 100644 --- a/docs/reference/sensors.md +++ b/docs/reference/sensors.md @@ -4,9 +4,9 @@ ```cards sensors.color1.onColorDetected(ColorSensorColor.Blue, function () {}) -sensors.color1.onLightChanged(LightIntensityMode.Reflected, LightCondition.Dark, function () {}) -sensors.color1.pauseForLight(LightIntensityMode.Reflected, LightCondition.Dark) -sensors.color1.pauseForColor(ColorSensorColor.Blue) +sensors.color1.onLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark, function () {}) +sensors.color1.pauseUntilLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark) +sensors.color1.pauseUntilColorDetected(ColorSensorColor.Blue) sensors.color1.color(); sensors.color1.light(LightIntensityMode.Ambient) sensors.color(ColorSensorColor.Blue) diff --git a/libs/color-sensor/color.ts b/libs/color-sensor/color.ts index eb0713e9..7d66e7bf 100644 --- a/libs/color-sensor/color.ts +++ b/libs/color-sensor/color.ts @@ -145,15 +145,15 @@ namespace sensors { * Waits for the given color to be detected * @param color the color to detect */ - //% help=sensors/color-sensor/pause-for-color - //% block="pause **color sensor** %this|for %color=colorEnumPicker" - //% blockId=colorPauseForColorDetected + //% help=sensors/color-sensor/pause-until-color-detected + //% block="pause until **color sensor** %this|detected %color=colorEnumPicker" + //% blockId=colorpauseUntilColorDetectedDetected //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" //% weight=99 blockGap=8 //% group="Color Sensor" - pauseForColor(color: number) { + pauseUntilColorDetected(color: number) { this.setMode(ColorSensorMode.Color); if (this.color() != color) { const v = this._colorEventValue(color); @@ -184,15 +184,15 @@ namespace sensors { * @param condition the light condition * @param handler the code to run when detected */ - //% help=sensors/color-sensor/on-light-changed - //% block="on **color sensor** %this|%mode|%condition" - //% blockId=colorOnLightChanged + //% help=sensors/color-sensor/on-light-condition-detected + //% block="on **color sensor** %this|detected %mode|%condition" + //% blockId=colorOnLightDetected //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" //% weight=89 blockGap=12 //% group="Color Sensor" - onLightChanged(mode: LightIntensityMode, condition: LightCondition, handler: () => void) { + onLightConditionDetected(mode: LightIntensityMode, condition: LightCondition, handler: () => void) { this.setMode(mode) control.onEvent(this._id, condition, handler); } @@ -201,15 +201,15 @@ namespace sensors { * Wait for the given color to be detected * @param color the color to detect */ - //% help=sensors/color-sensor/pause-for-light - //% block="pause **color sensor** %this|for %mode|%condition" - //% blockId=colorPauseForLight + //% help=sensors/color-sensor/pause-until-light-condition-detected + //% block="pause until **color sensor** %this|detected %mode|%condition" + //% blockId=colorPauseUntilLightConditionDetected //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" //% weight=88 blockGap=8 //% group="Color Sensor" - pauseForLight(mode: LightIntensityMode, condition: LightCondition) { + pauseUntilLightConditionDetected(mode: LightIntensityMode, condition: LightCondition) { this.setMode(mode) if (this.thresholdDetector.state != condition) control.waitForEvent(this._id, condition) diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor.md b/libs/color-sensor/docs/reference/sensors/color-sensor.md index 6f17219a..a83f7093 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor.md @@ -2,9 +2,9 @@ ```cards sensors.color1.onColorDetected(ColorSensorColor.Blue, function () {}) -sensors.color1.onLightChanged(LightIntensityMode.Reflected, LightCondition.Dark, function () {}) -sensors.color1.pauseForLight(LightIntensityMode.Reflected, LightCondition.Dark) -sensors.color1.pauseForColor(ColorSensorColor.Blue) +sensors.color1.onLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark, function () {}) +sensors.color1.pauseUntilLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark) +sensors.color1.pauseUntilColorDetected(ColorSensorColor.Blue) sensors.color1.color(); sensors.color1.light(LightIntensityMode.Ambient) ``` @@ -12,8 +12,8 @@ sensors.color1.light(LightIntensityMode.Ambient) ## See slso [on color detected](/reference/sensors/color-sensor/on-color-detected), -[pause for color](/reference/sensors/color-sensor/pause-for-color), -[on light changed](/reference/sensors/color-sensor/on-light-changed), -[pause for light](/reference/sensors/color-sensor/pause-for-light), +[pause until color detected](/reference/sensors/color-sensor/pause-until-color-detected), +[on light condition detected](/reference/sensors/color-sensor/on-light-condition-detected), +[pause until light condition detected](/reference/sensors/color-sensor/pause-until-light-condition-detected), [color](/reference/sensors/color-sensor/color), [light](/reference/sensors/color-sensor/ambient-light) diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor/on-color-detected.md b/libs/color-sensor/docs/reference/sensors/color-sensor/on-color-detected.md index 397d1307..c1818948 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor/on-color-detected.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor/on-color-detected.md @@ -24,4 +24,4 @@ sensors.color1.onColorDetected(ColorSensorColor.Blue, function () { ``` ## See also -[pause for color](/reference/sensors/color-sensor/pause-for-color), [color](/reference/sensors/color) \ No newline at end of file +[pause until color detected](/reference/sensors/color-sensor/pause-until-color-detected), [color](/reference/sensors/color) \ No newline at end of file diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor/on-light-changed.md b/libs/color-sensor/docs/reference/sensors/color-sensor/on-light-condition-detected.md similarity index 77% rename from libs/color-sensor/docs/reference/sensors/color-sensor/on-light-changed.md rename to libs/color-sensor/docs/reference/sensors/color-sensor/on-light-condition-detected.md index c144ab49..93f85456 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor/on-light-changed.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor/on-light-condition-detected.md @@ -3,7 +3,7 @@ Run some code when the amount of light dectected changes. ```sig -sensors.color1.onLightChanged(LightIntensityMode.Reflected, LightCondition.Dark, function () { +sensors.color1.onLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark, function () { }) ``` @@ -21,7 +21,7 @@ You can check for a change in either _ambient_ or _reflected_ light and run some Show a message on the screen when the ambient light goes dark. ```blocks -sensors.color1.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function() { +sensors.color1.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Dark, function() { brick.clearScreen(); brick.showString("It just got dark", 1) brick.showString("Can you see me?", 2) diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor/pause-for-color.md b/libs/color-sensor/docs/reference/sensors/color-sensor/pause-until-color-detected.md similarity index 77% rename from libs/color-sensor/docs/reference/sensors/color-sensor/pause-for-color.md rename to libs/color-sensor/docs/reference/sensors/color-sensor/pause-until-color-detected.md index 0ccdb2d5..71b5d761 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor/pause-for-color.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor/pause-until-color-detected.md @@ -1,9 +1,9 @@ -# pause For Color +# pause Until Color Detected Wait for the sensor to see a certain color. ```sig -sensors.color1.pauseForColor(ColorSensorColor.Blue) +sensors.color1.pauseUntilColorDetected(ColorSensorColor.Blue) ``` The [color](/reference/sensors/color) you choose to look for is one of the colors that the sensor can detect. If you want to use colors for tracking, it's best to use a color that is the same or very close to the ones the sensor detects. @@ -18,7 +18,7 @@ Wait for the sensor to see ``blue``. Then, show an expression on the screen. ```blocks brick.showString("Waiting for blue", 1) -sensors.color1.pauseForColor(ColorSensorColor.Blue) +sensors.color1.pauseUntilColorDetected(ColorSensorColor.Blue) brick.clearScreen() brick.showImage(images.expressionsSick) ``` diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor/pause-for-light.md b/libs/color-sensor/docs/reference/sensors/color-sensor/pause-until-light-condition-detected.md similarity index 62% rename from libs/color-sensor/docs/reference/sensors/color-sensor/pause-for-light.md rename to libs/color-sensor/docs/reference/sensors/color-sensor/pause-until-light-condition-detected.md index 55f51eae..b6aeb927 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor/pause-for-light.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor/pause-until-light-condition-detected.md @@ -1,9 +1,9 @@ -# pause For Light +# pause Until Light Condition Detected -Wait for the light condition to change. +Wait until a particular light condition is detected. ```sig -sensors.color1.pauseForLight(LightIntensityMode.Reflected, LightCondition.Dark) +sensors.color1.pauseUntilLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark) ``` You can wait for a change in either _ambient_ or _reflected_ light. This event happens when the sensor detects light going to ``dark`` or to ``bright``. You choose what condition you will wait for. @@ -19,11 +19,11 @@ Wait for the ambient light to go dark, then show an expression on the screen. ```blocks brick.showString("Waiting for dark", 1) -sensors.color1.pauseForLight(LightIntensityMode.Reflected, LightCondition.Dark) +sensors.color1.pauseUntilLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark) brick.clearScreen() brick.showImage(images.expressionsSick) ``` ## See also -[on light changed](/reference/sensors/color-sensor/on-light-changed) \ No newline at end of file +[on light condition detected](/reference/sensors/color-sensor/on-light-condition-detected) \ No newline at end of file diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor/set-threshold.md b/libs/color-sensor/docs/reference/sensors/color-sensor/set-threshold.md index 3ee70f91..1a0ad296 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor/set-threshold.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor/set-threshold.md @@ -12,7 +12,7 @@ After setting a threshold, any event for that light condition won't happen until ```block sensors.color1.setThreshold(LightCondition.Dark, 20) -sensors.color1.onLightChanged(LightIntensityMode.Reflected, LightCondition.Dark, function () { +sensors.color1.onLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark, function () { brick.showMood(moods.sleeping) }) ``` @@ -28,7 +28,7 @@ Make a daylight alarm. When the ambient light reaches `70` flash the status ligh ```blocks sensors.color3.setThreshold(LightCondition.Bright, 70) -sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Bright, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Ambient, LightCondition.Bright, function () { brick.setStatusLight(StatusLight.GreenFlash) for (let i = 0; i < 5; i++) { music.playSoundEffectUntilDone(sounds.mechanicalBackingAlert) diff --git a/libs/color-sensor/docs/reference/sensors/color-sensor/threshold.md b/libs/color-sensor/docs/reference/sensors/color-sensor/threshold.md index 790ea7b7..19f31db6 100644 --- a/libs/color-sensor/docs/reference/sensors/color-sensor/threshold.md +++ b/libs/color-sensor/docs/reference/sensors/color-sensor/threshold.md @@ -17,7 +17,7 @@ Light intensity is measured from `0` (very dark) to `100` (very bright). A _thre Find out what light level is set as the ``dark`` threshold when a dark light event happens. ```blocks -sensors.color3.onLightChanged(LightIntensityMode.Reflected, LightCondition.Dark, function () { +sensors.color3.onLightConditionDetected(LightIntensityMode.Reflected, LightCondition.Dark, function () { brick.showValue("DarknessThresholdValue", sensors.color3.threshold(LightCondition.Dark), 1) }) ```