added event for color changes

This commit is contained in:
Peli de Halleux
2017-10-24 23:10:27 -07:00
parent 0e1a3b7e6b
commit 1a5992408b
3 changed files with 51 additions and 0 deletions

View File

@ -26,6 +26,9 @@
"input.Button.wasPressed": "See if the button was pressed again since the last time you checked.",
"input.ColorSensor.ambientLight": "Get current ambient light value from the color sensor.",
"input.ColorSensor.color": "Get the current color from the color sensor.",
"input.ColorSensor.onColorDetected": "Registers code to run when the given color is detected",
"input.ColorSensor.onColorDetected|param|color": "the color to dtect",
"input.ColorSensor.onColorDetected|param|handler": "the code to run when detected",
"input.ColorSensor.reflectedLight": "Get current reflected light value from the color sensor.",
"input.GyroSensor.angle": "Get the current angle from the gyroscope.",
"input.GyroSensor.rate": "Get the current rotation rate from the gyroscope.",

View File

@ -2,6 +2,14 @@
"ButtonEvent.Click|block": "click",
"ButtonEvent.Down|block": "down",
"ButtonEvent.Up|block": "up",
"ColorSensorColor.Black|block": "black",
"ColorSensorColor.Blue|block": "blue",
"ColorSensorColor.Brown|block": "brown",
"ColorSensorColor.Green|block": "green",
"ColorSensorColor.None|block": "none",
"ColorSensorColor.Red|block": "red",
"ColorSensorColor.White|block": "white",
"ColorSensorColor.Yellow|block": "yellow",
"LightsPattern.GreenFlash|block": "Flashing Green",
"LightsPattern.GreenPulse|block": "Pulsing Green",
"LightsPattern.Green|block": "Green",
@ -27,6 +35,7 @@
"input.Button.wasPressed|block": "%button|was pressed",
"input.ColorSensor.ambientLight|block": "%color| ambient light",
"input.ColorSensor.color|block": "%color| color",
"input.ColorSensor.onColorDetected|block": "on %sensor|detected %color",
"input.ColorSensor.reflectedLight|block": "%color| reflected light",
"input.GyroSensor.angle|block": "%sensor|angle",
"input.GyroSensor.rate|block": "%sensor|rotation rate",