docs skeleton
This commit is contained in:
parent
97663d2b83
commit
3690f409b0
@ -4,4 +4,5 @@
|
||||
|
||||
## See Also
|
||||
|
||||
[touch sensor](/reference/sensors/touch-sensor)
|
||||
[touch sensor](/reference/sensors/touch-sensor),
|
||||
[color sensor](/reference/sensors/color-sensor)
|
16
libs/color-sensor/docs/reference/sensors/color-sensor.md
Normal file
16
libs/color-sensor/docs/reference/sensors/color-sensor.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Color Sensor
|
||||
|
||||
```cards
|
||||
sensors.colorSensor1.onColorDetected(ColorSensorColor.Blue, function () {
|
||||
})
|
||||
sensors.colorSensor1.color();
|
||||
sensors.colorSensor1.ambientLight();
|
||||
sensors.colorSensor1.reflectedLight();
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
[on color detected](/reference/sensors/color-sensor/on-color-detected),
|
||||
[color](/reference/sensors/color-sensor/color),
|
||||
[ambient light](/reference/sensors/color-sensor/ambient-light),
|
||||
[reflected light](/reference/sensors/color-sensor/reflected-light),
|
@ -0,0 +1,11 @@
|
||||
# Ambient Light
|
||||
|
||||
```blocks
|
||||
loops.forever(function () {
|
||||
if (sensors.colorSensor1.ambientLight() > 20) {
|
||||
brick.setStatusLight(LightsPattern.Green)
|
||||
} else {
|
||||
brick.setStatusLight(LightsPattern.Orange)
|
||||
}
|
||||
})
|
||||
```
|
@ -0,0 +1,11 @@
|
||||
# color
|
||||
|
||||
```blocks
|
||||
loops.forever(function () {
|
||||
if (sensors.colorSensor1.color() == ColorSensorColor.Green) {
|
||||
brick.setStatusLight(LightsPattern.Green)
|
||||
} else {
|
||||
brick.setStatusLight(LightsPattern.Orange)
|
||||
}
|
||||
})
|
||||
```
|
@ -0,0 +1,16 @@
|
||||
# On Color Detected
|
||||
|
||||
```sig
|
||||
sensors.colorSensor1.onColorDetected(ColorSensorColor.Blue, function () { })
|
||||
```
|
||||
|
||||
# Parameters
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
```blocks
|
||||
sensors.colorSensor1.onColorDetected(ColorSensorColor.Blue, function () {
|
||||
brick.showImage(images.expressionsSick)
|
||||
})
|
||||
```
|
@ -0,0 +1,11 @@
|
||||
# Reflected Light
|
||||
|
||||
```blocks
|
||||
loops.forever(function () {
|
||||
if (sensors.colorSensor1.reflectedLight() > 20) {
|
||||
brick.setStatusLight(LightsPattern.Green)
|
||||
} else {
|
||||
brick.setStatusLight(LightsPattern.Orange)
|
||||
}
|
||||
})
|
||||
```
|
Loading…
Reference in New Issue
Block a user