2018-02-08 18:35:47 +01:00
|
|
|
# Sensors
|
|
|
|
|
2018-02-21 23:03:56 +01:00
|
|
|
# Color
|
|
|
|
|
|
|
|
```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.color();
|
|
|
|
sensors.color1.light(LightIntensityMode.Ambient)
|
|
|
|
sensors.color(ColorSensorColor.Blue)
|
|
|
|
```
|
|
|
|
|
2018-02-10 03:17:12 +01:00
|
|
|
## Touch
|
|
|
|
|
|
|
|
```cards
|
|
|
|
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {})
|
|
|
|
sensors.touch1.pauseUntil(ButtonEvent.Pressed)
|
|
|
|
sensors.touch1.wasPressed()
|
|
|
|
sensors.touch1.isPressed()
|
|
|
|
```
|
|
|
|
|
2018-02-08 18:35:47 +01:00
|
|
|
## Gyro
|
|
|
|
|
|
|
|
```cards
|
|
|
|
sensors.gyro1.angle();
|
|
|
|
sensors.gyro1.rate();
|
|
|
|
sensors.gyro1.reset();
|
2018-02-11 18:01:46 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Ultrasonic
|
|
|
|
|
|
|
|
```cards
|
|
|
|
sensors.ultrasonic4.onEvent(UltrasonicSensorEvent.ObjectDetected, function () {});
|
|
|
|
sensors.ultrasonic1.distance();
|
|
|
|
sensors.ultrasonic1.pauseUntil(UltrasonicSensorEvent.ObjectDetected);
|
|
|
|
```
|
2018-02-20 19:38:41 +01:00
|
|
|
|
|
|
|
## Infrared
|
|
|
|
|
|
|
|
```cards
|
2018-02-26 19:39:15 +01:00
|
|
|
sensors.infrared1.onEvent(null, function () {});
|
|
|
|
sensors.infrared1.pauseUntil(null);
|
|
|
|
sensors.infrared1.proximity();
|
2018-02-20 19:38:41 +01:00
|
|
|
|
|
|
|
```
|
2018-02-22 07:35:51 +01:00
|
|
|
|
|
|
|
## Infrared beacon button
|
|
|
|
|
|
|
|
```cards
|
|
|
|
sensors.remoteButtonCenter.onEvent(ButtonEvent.Pressed, function () {})
|
|
|
|
sensors.remoteButtonCenter.pauseUntil(ButtonEvent.Pressed);
|
|
|
|
sensors.remoteButtonCenter.isPressed()
|
|
|
|
sensors.remoteButtonCenter.wasPressed()
|
2018-02-26 19:39:15 +01:00
|
|
|
sensors.infrared1.setRemoteChannel(null)
|
2018-02-22 07:35:51 +01:00
|
|
|
```
|