docs skeleton

This commit is contained in:
Peli de Halleux 2017-11-29 22:09:12 -08:00
parent 97663d2b83
commit 3690f409b0
6 changed files with 67 additions and 1 deletions

View File

@ -4,4 +4,5 @@
## See Also
[touch sensor](/reference/sensors/touch-sensor)
[touch sensor](/reference/sensors/touch-sensor),
[color sensor](/reference/sensors/color-sensor)

View 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),

View File

@ -0,0 +1,11 @@
# Ambient Light
```blocks
loops.forever(function () {
if (sensors.colorSensor1.ambientLight() > 20) {
brick.setStatusLight(LightsPattern.Green)
} else {
brick.setStatusLight(LightsPattern.Orange)
}
})
```

View File

@ -0,0 +1,11 @@
# color
```blocks
loops.forever(function () {
if (sensors.colorSensor1.color() == ColorSensorColor.Green) {
brick.setStatusLight(LightsPattern.Green)
} else {
brick.setStatusLight(LightsPattern.Orange)
}
})
```

View File

@ -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)
})
```

View File

@ -0,0 +1,11 @@
# Reflected Light
```blocks
loops.forever(function () {
if (sensors.colorSensor1.reflectedLight() > 20) {
brick.setStatusLight(LightsPattern.Green)
} else {
brick.setStatusLight(LightsPattern.Orange)
}
})
```