fixing a bunch of snippets
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
# Touch Sensor
|
||||
|
||||
```cards
|
||||
sensors.touchSensor1.onEvent(TouchSensorEvent.Pressed, function () {
|
||||
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
|
||||
brick.showImage(images.expressionsBigSmile)
|
||||
})
|
||||
sensors.touchSensor1.isPressed();
|
||||
sensors.touchSensor1.wasPressed();
|
||||
sensors.touch1.isPressed();
|
||||
sensors.touch1.wasPressed();
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
```blocks
|
||||
loops.forever(function () {
|
||||
if (sensors.touchSensor1.isPressed()) {
|
||||
brick.setStatusLight(LightsPattern.Green)
|
||||
if (sensors.touch1.isPressed()) {
|
||||
brick.setLight(BrickLight.Green)
|
||||
} else {
|
||||
brick.setStatusLight(LightsPattern.Orange)
|
||||
brick.setLight(BrickLight.Orange)
|
||||
}
|
||||
})
|
||||
```
|
@ -1,7 +1,7 @@
|
||||
# On Event
|
||||
|
||||
```sig
|
||||
sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () { })
|
||||
sensors.touch1.onEvent(TouchSensorEvent.Released, function () { })
|
||||
```
|
||||
|
||||
# Parameters
|
||||
@ -10,7 +10,7 @@ sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () { })
|
||||
|
||||
|
||||
```blocks
|
||||
sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () {
|
||||
sensors.touch1.onEvent(TouchSensorEvent.Released, function () {
|
||||
brick.showImage(images.expressionsSick)
|
||||
})
|
||||
```
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
```blocks
|
||||
loops.forever(function () {
|
||||
if (sensors.touchSensor1.wasPressed()) {
|
||||
brick.setStatusLight(LightsPattern.Green)
|
||||
if (sensors.touch1.wasPressed()) {
|
||||
brick.setLight(BrickLight.Green)
|
||||
} else {
|
||||
brick.setStatusLight(LightsPattern.Orange)
|
||||
brick.setLight(BrickLight.Orange)
|
||||
}
|
||||
})
|
||||
```
|
Reference in New Issue
Block a user