adding bare docs

This commit is contained in:
Peli de Halleux 2017-11-28 16:24:22 -08:00
parent f22edac84d
commit 7e502b1749
6 changed files with 58 additions and 8 deletions

View File

@ -9,11 +9,4 @@ sensors.touchSensor1.onEvent(TouchSensorEvent.Pressed, function () {
sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () { sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () {
brick.showImage(images.expressionsSick) brick.showImage(images.expressionsSick)
}) })
loops.forever(function () {
if (sensors.touchSensor1.isTouched()) {
brick.setStatusLight(LightsPattern.Green)
} else {
brick.setStatusLight(LightsPattern.Orange)
}
})
``` ```

View File

@ -1,3 +1,7 @@
# Reference # Reference
TODO
## See Also
[touch sensor](/reference/sensors/touch-sensor)

View File

@ -0,0 +1,15 @@
# Touch Sensor
```cards
sensors.touchSensor1.onEvent(TouchSensorEvent.Pressed, function () {
brick.showImage(images.expressionsBigSmile)
})
sensors.touchSensor1.isPressed();
sensors.touchSensor1.wasPressed();
```
## See Also
[on Event](/reference/sensors/touch-sensor/on-event),
[is pressed](reference/sensors/touch-sensor/is-pressed),
[was pressed](reference/sensors/touch-sensor/was-pressed)

View File

@ -0,0 +1,11 @@
# is Pressed
```blocks
loops.forever(function () {
if (sensors.touchSensor1.isPressed()) {
brick.setStatusLight(LightsPattern.Green)
} else {
brick.setStatusLight(LightsPattern.Orange)
}
})
```

View File

@ -0,0 +1,16 @@
# On Event
```sig
sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () { })
```
# Parameters
## Examples
```blocks
sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () {
brick.showImage(images.expressionsSick)
})
```

View File

@ -0,0 +1,11 @@
# was Pressed
```blocks
loops.forever(function () {
if (sensors.touchSensor1.wasPressed()) {
brick.setStatusLight(LightsPattern.Green)
} else {
brick.setStatusLight(LightsPattern.Orange)
}
})
```