js-slang
Version:
Javascript-based implementations of Source, written in Typescript
213 lines (212 loc) • 15.4 kB
JSON
{
"ev3_ambientLightIntensity": {
"title": "ev3_ambientLightIntensity(colorSensor) → {number}",
"description": "<div><h4>ev3_ambientLightIntensity(colorSensor) → {number}</h4><div class=\"description\">\n Gets the ambient light intensity seen by the colour sensor.\n</div></div>",
"meta": "func"
},
"ev3_colorSensor": {
"title": "ev3_colorSensor() → {peripheral}",
"description": "<div><h4>ev3_colorSensor() → {peripheral}</h4><div class=\"description\">\n Gets the colour sensor connected any of ports 1, 2, 3 or 4.\n</div></div>",
"meta": "func"
},
"ev3_colorSensorBlue": {
"title": "ev3_colorSensorBlue(colorSensor) → {number}",
"description": "<div><h4>ev3_colorSensorBlue(colorSensor) → {number}</h4><div class=\"description\">\n Gets the amount of blue seen by the colour sensor.\n</div></div>",
"meta": "func"
},
"ev3_colorSensorGetColor": {
"title": "ev3_colorSensorGetColor(colorSensor) → {number}",
"description": "<div><h4>ev3_colorSensorGetColor(colorSensor) → {number}</h4><div class=\"description\">\n Gets the colour as seen by the colour sensor.\n\nPossible colour return values are:\n<ul><li>0 none</li>\n<li>1 black</li>\n<li>2 blue</li>\n<li>3 green</li>\n<li>4 yellow</li>\n<li>5 red</li>\n<li>6 white</li>\n<li>7 brown</li></ul>\n</div></div>",
"meta": "func"
},
"ev3_colorSensorGreen": {
"title": "ev3_colorSensorGreen(colorSensor) → {number}",
"description": "<div><h4>ev3_colorSensorGreen(colorSensor) → {number}</h4><div class=\"description\">\n Gets the amount of green seen by the colour sensor.\n</div></div>",
"meta": "func"
},
"ev3_colorSensorRed": {
"title": "ev3_colorSensorRed(colorSensor) → {number}",
"description": "<div><h4>ev3_colorSensorRed(colorSensor) → {number}</h4><div class=\"description\">\n Gets the amount of red seen by the colour sensor.\n</div></div>",
"meta": "func"
},
"ev3_connected": {
"title": "ev3_connected(obj) → {boolean}",
"description": "<div><h4>ev3_connected(obj) → {boolean}</h4><div class=\"description\">\n Checks if the peripheral is connected.\n</div></div>",
"meta": "func"
},
"ev3_gyroSensor": {
"title": "ev3_gyroSensor() → {peripheral}",
"description": "<div><h4>ev3_gyroSensor() → {peripheral}</h4><div class=\"description\">\n Gets the gyro sensor connected any of ports 1, 2, 3 or 4.\n</div></div>",
"meta": "func"
},
"ev3_gyroSensorAngle": {
"title": "ev3_gyroSensorAngle(gyroSensor) → {number}",
"description": "<div><h4>ev3_gyroSensorAngle(gyroSensor) → {number}</h4><div class=\"description\">\n Gets the absolute angle detected by the gyro sensor, measured from when\nthe sensor was last switched to angle mode from sensor rate mode.\n</div></div>",
"meta": "func"
},
"ev3_gyroSensorRate": {
"title": "ev3_gyroSensorRate(gyroSensor) → {number}",
"description": "<div><h4>ev3_gyroSensorRate(gyroSensor) → {number}</h4><div class=\"description\">\n Gets the rate of rotation detected by the gyro sensor.\n</div></div>",
"meta": "func"
},
"ev3_hello": {
"title": "ev3_hello() → {string}",
"description": "<div><h4>ev3_hello() → {string}</h4><div class=\"description\">\n Returns a hello world message.\n</div></div>",
"meta": "func"
},
"ev3_ledGetBrightness": {
"title": "ev3_ledGetBrightness(led) → {number}",
"description": "<div><h4>ev3_ledGetBrightness(led) → {number}</h4><div class=\"description\">\n Gets the brightness of the given LED.\n\nThe brightness is a number ranging from 0 (off) to 255 (maximum).\n</div></div>",
"meta": "func"
},
"ev3_ledLeftGreen": {
"title": "ev3_ledLeftGreen() → {peripheral}",
"description": "<div><h4>ev3_ledLeftGreen() → {peripheral}</h4><div class=\"description\">\n Gets the left green LED.\n\nNote that the four LEDs on the EV3 are laid out in two pairs of green and\nred. If both in a pair are turned on, you can vary the colours in a small\nspectrum between red and green.\n</div></div>",
"meta": "func"
},
"ev3_ledLeftRed": {
"title": "ev3_ledLeftRed() → {peripheral}",
"description": "<div><h4>ev3_ledLeftRed() → {peripheral}</h4><div class=\"description\">\n Gets the left red LED.\n\nNote that the four LEDs on the EV3 are laid out in two pairs of green and\nred. If both in a pair are turned on, you can vary the colours in a small\nspectrum between red and green.\n</div></div>",
"meta": "func"
},
"ev3_ledRightGreen": {
"title": "ev3_ledRightGreen() → {peripheral}",
"description": "<div><h4>ev3_ledRightGreen() → {peripheral}</h4><div class=\"description\">\n Gets the right green LED.\n\nNote that the four LEDs on the EV3 are laid out in two pairs of green and\nred. If both in a pair are turned on, you can vary the colours in a small\nspectrum between red and green.\n</div></div>",
"meta": "func"
},
"ev3_ledRightRed": {
"title": "ev3_ledRightRed() → {peripheral}",
"description": "<div><h4>ev3_ledRightRed() → {peripheral}</h4><div class=\"description\">\n Gets the right red LED.\n\nNote that the four LEDs on the EV3 are laid out in two pairs of green and\nred. If both in a pair are turned on, you can vary the colours in a small\nspectrum between red and green.\n</div></div>",
"meta": "func"
},
"ev3_ledSetBrightness": {
"title": "ev3_ledSetBrightness(led, brightness)",
"description": "<div><h4>ev3_ledSetBrightness(led, brightness)</h4><div class=\"description\">\n Sets the brightness of the given LED.\n\nThe brightness is a number ranging from 0 (off) to 255 (maximum).\n</div></div>",
"meta": "func"
},
"ev3_motorA": {
"title": "ev3_motorA() → {peripheral}",
"description": "<div><h4>ev3_motorA() → {peripheral}</h4><div class=\"description\">\n Gets the motor connected to port A.\n</div></div>",
"meta": "func"
},
"ev3_motorB": {
"title": "ev3_motorB() → {peripheral}",
"description": "<div><h4>ev3_motorB() → {peripheral}</h4><div class=\"description\">\n Gets the motor connected to port B.\n</div></div>",
"meta": "func"
},
"ev3_motorC": {
"title": "ev3_motorC() → {peripheral}",
"description": "<div><h4>ev3_motorC() → {peripheral}</h4><div class=\"description\">\n Gets the motor connected to port C.\n</div></div>",
"meta": "func"
},
"ev3_motorD": {
"title": "ev3_motorD() → {peripheral}",
"description": "<div><h4>ev3_motorD() → {peripheral}</h4><div class=\"description\">\n Gets the motor connected to port D.\n</div></div>",
"meta": "func"
},
"ev3_motorGetPosition": {
"title": "ev3_motorGetPosition(motor) → {number}",
"description": "<div><h4>ev3_motorGetPosition(motor) → {number}</h4><div class=\"description\">\n Gets the motor's current position, in pulses of the rotary encoder.\n</div></div>",
"meta": "func"
},
"ev3_motorGetSpeed": {
"title": "ev3_motorGetSpeed(motor) → {number}",
"description": "<div><h4>ev3_motorGetSpeed(motor) → {number}</h4><div class=\"description\">\n Gets the motor's current speed, in tacho counts per second.\n</div></div>",
"meta": "func"
},
"ev3_motorSetSpeed": {
"title": "ev3_motorSetSpeed(motor, speed)",
"description": "<div><h4>ev3_motorSetSpeed(motor, speed)</h4><div class=\"description\">\n Sets the speed the motor will run at the next time <a href=\"global.html#ev3_motorStart\">ev3_motorStart</a>\nis called.\n</div></div>",
"meta": "func"
},
"ev3_motorSetStopAction": {
"title": "ev3_motorSetStopAction(motor, stopAction)",
"description": "<div><h4>ev3_motorSetStopAction(motor, stopAction)</h4><div class=\"description\">\n Sets the stop action of the motor.\n\nPossible stop actions are:\n\n<ul><li><code>\"coast\"</code>: power will be removed from the motor and it will freely coast to a stop.</li>\n<li><code>\"brake\"</code>: power will be removed from the motor and a passive electrical load will be placed on the motor. This load will absorb the energy from the rotation of the motors and cause the motor to stop more quickly than coasting.</li>\n<li><code>\"hold\"</code>: actively try to hold the motor at the current position. If an external force tries to turn the motor, the motor will ‘push back’ to maintain its position.</li></ul>\n</div></div>",
"meta": "func"
},
"ev3_motorStart": {
"title": "ev3_motorStart(motor)",
"description": "<div><h4>ev3_motorStart(motor)</h4><div class=\"description\">\n Causes the motor to start with the previously set speed and stop action\n(see motorSetSpeed and motorSetStopAction).\n</div></div>",
"meta": "func"
},
"ev3_motorStop": {
"title": "ev3_motorStop(motor)",
"description": "<div><h4>ev3_motorStop(motor)</h4><div class=\"description\">\n Causes the motor to stop using the previously set stop action.\n</div></div>",
"meta": "func"
},
"ev3_pause": {
"title": "ev3_pause(time)",
"description": "<div><h4>ev3_pause(time)</h4><div class=\"description\">\n Pauses for a period of time.\n</div></div>",
"meta": "func"
},
"ev3_playSequence": {
"title": "ev3_playSequence(beeps)",
"description": "<div><h4>ev3_playSequence(beeps)</h4><div class=\"description\">\n Causes the robot to emit a sequence of beeps. Returns after the beeps are\nemitted.\n\nThe beep sequence is an array of <code>[frequency, length (ms), delay (ms),\n...]</code>. For example, <code>[1000, 500, 500, 250, 500, 0]</code> will\ncause the robot to emit a 1000 Hz beep for 500 ms, wait 500 ms, then emit a\n250 Hz beep for 500 ms.\n</div></div>",
"meta": "func"
},
"ev3_reflectedLightIntensity": {
"title": "ev3_reflectedLightIntensity(colorSensor) → {number}",
"description": "<div><h4>ev3_reflectedLightIntensity(colorSensor) → {number}</h4><div class=\"description\">\n Gets the reflected light intensity seen by the colour sensor.\n</div></div>",
"meta": "func"
},
"ev3_runForTime": {
"title": "ev3_runForTime(motor, time, speed)",
"description": "<div><h4>ev3_runForTime(motor, time, speed)</h4><div class=\"description\">\n Causes the motor to rotate for a specified duration at the specified speed.\n\nNote: this works by sending instructions to the motors. This will return almost immediately, without waiting for the motor to actually run for the specified duration. If you wish to wait, use <a href=\"global.html#ev3_pause\">ev3_pause</a>.\n</div></div>",
"meta": "func"
},
"ev3_runToAbsolutePosition": {
"title": "ev3_runToAbsolutePosition(motor, position, speed)",
"description": "<div><h4>ev3_runToAbsolutePosition(motor, position, speed)</h4><div class=\"description\">\n Causes the motor to rotate to the given absolute position (as reported by\n<a href=\"global.html#ev3_motorGetPosition\">ev3_motorGetPosition</a>) with the given speed.\n\nNote: this works by sending instructions to the motors. This will return almost immediately, without waiting for the motor to reach the given absolute position. If you wish to wait, use <a href=\"global.html#ev3_pause\">ev3_pause</a>.\n</div></div>",
"meta": "func"
},
"ev3_runToRelativePosition": {
"title": "ev3_runToRelativePosition(motor, position, speed)",
"description": "<div><h4>ev3_runToRelativePosition(motor, position, speed)</h4><div class=\"description\">\n Causes the motor to rotate until the position reaches <code><a href=\"global.html#ev3_motorGetPosition\">ev3_motorGetPosition</a>()\n + position</code> with the given speed.\n\nNote: this works by sending instructions to the motors. This will return almost immediately, without waiting for the motor to reach the given absolute position. If you wish to wait, use <a href=\"global.html#ev3_pause\">ev3_pause</a>.\n</div></div>",
"meta": "func"
},
"ev3_speak": {
"title": "ev3_speak(words)",
"description": "<div><h4>ev3_speak(words)</h4><div class=\"description\">\n Makes the robot speak the given words through its speaker. Returns after the\nwords are spoken.\n</div></div>",
"meta": "func"
},
"ev3_touchSensor1": {
"title": "ev3_touchSensor1() → {peripheral}",
"description": "<div><h4>ev3_touchSensor1() → {peripheral}</h4><div class=\"description\">\n Gets the touch sensor connected to port 1.\n</div></div>",
"meta": "func"
},
"ev3_touchSensor2": {
"title": "ev3_touchSensor2() → {peripheral}",
"description": "<div><h4>ev3_touchSensor2() → {peripheral}</h4><div class=\"description\">\n Gets the touch sensor connected to port 2.\n</div></div>",
"meta": "func"
},
"ev3_touchSensor3": {
"title": "ev3_touchSensor3() → {peripheral}",
"description": "<div><h4>ev3_touchSensor3() → {peripheral}</h4><div class=\"description\">\n Gets the touch sensor connected to port 3.\n</div></div>",
"meta": "func"
},
"ev3_touchSensor4": {
"title": "ev3_touchSensor4() → {peripheral}",
"description": "<div><h4>ev3_touchSensor4() → {peripheral}</h4><div class=\"description\">\n Gets the touch sensor connected to port 4.\n</div></div>",
"meta": "func"
},
"ev3_touchSensorPressed": {
"title": "ev3_touchSensorPressed(touchSensor) → {boolean}",
"description": "<div><h4>ev3_touchSensorPressed(touchSensor) → {boolean}</h4><div class=\"description\">\n Gets whether the touch sensor is pressed.\n</div></div>",
"meta": "func"
},
"ev3_ultrasonicSensor": {
"title": "ev3_ultrasonicSensor() → {peripheral}",
"description": "<div><h4>ev3_ultrasonicSensor() → {peripheral}</h4><div class=\"description\">\n Gets the ultrasonic sensor connected any of ports 1, 2, 3 or 4.\n</div></div>",
"meta": "func"
},
"ev3_ultrasonicSensorDistance": {
"title": "ev3_ultrasonicSensorDistance(ultrasonicSensor) → {number}",
"description": "<div><h4>ev3_ultrasonicSensorDistance(ultrasonicSensor) → {number}</h4><div class=\"description\">\n Gets the distance read by the ultrasonic sensor in centimeters.\n</div></div>",
"meta": "func"
},
"ev3_waitForButtonPress": {
"title": "ev3_waitForButtonPress() → {number}",
"description": "<div><h4>ev3_waitForButtonPress() → {number}</h4><div class=\"description\">\n Waits for one of the buttons on the EV3's control face to be pressed, then\nreturns a value corresponding to the button that was pressed:\n\n<ul><li>0 enter (the middle button)</li>\n<li>1 back (the top left button)</li>\n<li>2 left</li>\n<li>3 right</li>\n<li>4 up</li>\n<li>5 down</li></ul>\n</div></div>",
"meta": "func"
}
}