updated docs

This commit is contained in:
Peli de Halleux 2016-05-05 11:16:14 -07:00
parent efce4c3698
commit 81b8b1b69c
10 changed files with 90 additions and 19 deletions

View File

@ -2,7 +2,6 @@
Provides access to basic micro:bit functionality.
```cards
basic.showNumber(0);
basic.showLeds(`

View File

@ -1,7 +1,6 @@
# Control
Runtime and event utilities.
```cards
control.inBackground(() => {

View File

@ -1,7 +1,6 @@
# Game
A single-LED sprite game engine
```cards
game.addScore(1);

View File

@ -1,7 +1,6 @@
# Images
Creation, manipulation and display of LED images.
```cards
images.createImage(`

View File

@ -1,7 +1,6 @@
# Input
Events and data from sensors
```cards
input.onButtonPressed(Button.A, () => {

View File

@ -1,7 +1,6 @@
# Led
Control of the LED screen.
```cards
led.plot(0, 0);
@ -10,7 +9,7 @@ led.point(0, 0);
led.brightness();
led.setBrightness(255);
led.stopAnimation();
led.plotBarGraph(0, 1023);
led.plotBarGraph(0, 0);
led.fadeIn();
led.fadeOut();
led.plotAll();

View File

@ -1,14 +1,13 @@
# Music
Generation of music tones through pin ``P0``.
```cards
music.playTone(0, 0);
music.ringTone(0);
music.rest(0);
music.noteFrequency(Note.C);
music.beat();
music.beat(BeatFraction.Whole);
music.tempo();
music.changeTempoBy(20);
music.setTempo(120);

View File

@ -1,7 +1,6 @@
# Pins
Control currents in Pins for analog/digital signals, servos, i2c, ...
```cards
pins.digitalReadPin(DigitalPin.P0);

View File

@ -1,8 +1,8 @@
# Serial
[Serial communication](/device/serial) between the BBC micro:bit and another computer.
Reading and writing data over a serial connection.
```cards
serial.writeValue(x, 0);
serial.writeLine("");
serial.writeValue("x", 0);
```

View File

@ -0,0 +1,79 @@
{
"A single-LED sprite game engine": "A single-LED sprite game engine",
"Adds points to the current score": "Adds points to the current score",
"Attaches code to run when the device is shaken.": "Attaches code to run when the device is shaken.",
"Attaches code to run when the logo is oriented downwards and the board is vertical.": "Attaches code to run when the logo is oriented downwards and the board is vertical.",
"Attaches code to run when the logo is oriented upwards and the board is vertical.": "Attaches code to run when the logo is oriented upwards and the board is vertical.",
"Attaches code to run when the screen is facing down.": "Attaches code to run when the screen is facing down.",
"Attaches code to run when the screen is facing up.": "Attaches code to run when the screen is facing up.",
"Cancels the current animation and clears other pending animations.": "Cancels the current animation and clears other pending animations.",
"Change the tempo by the specified amount": "Change the tempo by the specified amount",
"Configures the Pulse-width modulation (PWM) of the analog output to the given value in **microseconds** or `1/1000` milliseconds.\nIf this pin is not configured as an analog output (using `analog write pin`), the operation has no effect.": "Configures the Pulse-width modulation (PWM) of the analog output to the given value in **microseconds** or `1/1000` milliseconds.\nIf this pin is not configured as an analog output (using `analog write pin`), the operation has no effect.",
"Configures this IO pin as an analog/pwm output, configures the period to be 20 ms, and sets the pulse width, based on the value it is given **microseconds** or `1/1000` milliseconds.": "Configures this IO pin as an analog/pwm output, configures the period to be 20 ms, and sets the pulse width, based on the value it is given **microseconds** or `1/1000` milliseconds.",
"Control currents in Pins for analog/digital signals, servos, i2c, ...": "Control currents in Pins for analog/digital signals, servos, i2c, ...",
"Control of the LED screen.": "Control of the LED screen.",
"Creates an image that fits on the LED screen.": "Creates an image that fits on the LED screen.",
"Creates an image with 2 frames.": "Creates an image with 2 frames.",
"Creation, manipulation and display of LED images.": "Creation, manipulation and display of LED images.",
"Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.": "Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.",
"Displays a game over animation.": "Displays a game over animation.",
"Displays a vertical bar graph based on the `value` and `high` value.\nIf `high` is 0, the chart gets adjusted automatically.": "Displays a vertical bar graph based on the `value` and `high` value.\nIf `high` is 0, the chart gets adjusted automatically.",
"Do something when a button (``A``, ``B`` or both ``A+B``) is pressed": "Do something when a button (``A``, ``B`` or both ``A+B``) is pressed",
"Do something when a pin(``P0``, ``P1`` or both ``P2``) is pressed.": "Do something when a pin(``P0``, ``P1`` or both ``P2``) is pressed.",
"Draws an image on the LED screen.": "Draws an image on the LED screen.",
"Emits a Pulse-width modulation (PWM) signal to the current pitch pin. Use `analog set pitch pin` to define the pitch pin.": "Emits a Pulse-width modulation (PWM) signal to the current pitch pin. Use `analog set pitch pin` to define the pitch pin.",
"Events and data from sensors": "Events and data from sensors",
"Fades in the screen display.": "Fades in the screen display.",
"Fades out the screen brightness.": "Fades out the screen brightness.",
"Generation of music tones through pin ``P0``.": "Generation of music tones through pin ``P0``.",
"Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)": "Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)",
"Get the button state (pressed or not) for ``A`` and ``B``.": "Get the button state (pressed or not) for ``A`` and ``B``.",
"Get the current compass compass heading in degrees.": "Get the current compass compass heading in degrees.",
"Get the magnetic force value in ``micro-Teslas`` (``µT``). This function is not supported in the simulator.": "Get the magnetic force value in ``micro-Teslas`` (``µT``). This function is not supported in the simulator.",
"Get the on/off state of the specified LED using x, y coordinates. (0,0) is upper left.": "Get the on/off state of the specified LED using x, y coordinates. (0,0) is upper left.",
"Get the pin state (pressed or not). Requires to hold the ground to close the circuit.": "Get the pin state (pressed or not). Requires to hold the ground to close the circuit.",
"Get the screen brightness from 0 (off) to 255 (full bright).": "Get the screen brightness from 0 (off) to 255 (full bright).",
"Gets the current score": "Gets the current score",
"Gets the frequency of a note.": "Gets the frequency of a note.",
"Gets the number of milliseconds elapsed since power on.": "Gets the number of milliseconds elapsed since power on.",
"Gets the temperature in Celsius degrees (°C).": "Gets the temperature in Celsius degrees (°C).",
"Inverts the current LED display": "Inverts the current LED display",
"Obsolete, compass calibration is automatic.": "Obsolete, compass calibration is automatic.",
"Pause for the specified time in milliseconds": "Pause for the specified time in milliseconds",
"Plays a tone through pin ``P0`` for the given duration.": "Plays a tone through pin ``P0`` for the given duration.",
"Plays a tone through pin ``P0``.": "Plays a tone through pin ``P0``.",
"Prints a line of text to the serial": "Prints a line of text to the serial",
"Provides access to basic micro:bit functionality.": "Provides access to basic micro:bit functionality.",
"Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc.": "Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc.",
"Read the connector value as analog, that is, as a value comprised between 0 and 1023.": "Read the connector value as analog, that is, as a value comprised between 0 and 1023.",
"Read the specified pin or connector as either 0 or 1": "Read the specified pin or connector as either 0 or 1",
"Reading and writing data over a serial connection.": "Reading and writing data over a serial connection.",
"Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.": "Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.",
"Repeats the code forever in the background. On each iteration, allows other codes to run.": "Repeats the code forever in the background. On each iteration, allows other codes to run.",
"Resets the BBC micro:bit.": "Resets the BBC micro:bit.",
"Rests (plays nothing) for a specified time through pin ``P0``.": "Rests (plays nothing) for a specified time through pin ``P0``.",
"Returns the duration of a beat in milli-seconds": "Returns the duration of a beat in milli-seconds",
"Returns the tempo in beats per minute. Tempo is the speed (bpm = beats per minute) at which notes play. The larger the tempo value, the faster the notes will play.": "Returns the tempo in beats per minute. Tempo is the speed (bpm = beats per minute) at which notes play. The larger the tempo value, the faster the notes will play.",
"Runtime and event utilities.": "Runtime and event utilities.",
"Schedules code that run in the background.": "Schedules code that run in the background.",
"Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll.": "Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll.",
"Set a pin or connector value to either 0 or 1.": "Set a pin or connector value to either 0 or 1.",
"Set the connector value as analog. Value must be comprised between 0 and 1023.": "Set the connector value as analog. Value must be comprised between 0 and 1023.",
"Set the screen brightness from 0 (off) to 255 (full bright).": "Set the screen brightness from 0 (off) to 255 (full bright).",
"Sets the accelerometer sample range in gravities.": "Sets the accelerometer sample range in gravities.",
"Sets the current score value": "Sets the current score value",
"Sets the display mode between black and white and greyscale for rendering LEDs.": "Sets the display mode between black and white and greyscale for rendering LEDs.",
"Sets the pin used when using `pins->analog pitch`.": "Sets the pin used when using `pins->analog pitch`.",
"Sets the tempo to the specified amount": "Sets the tempo to the specified amount",
"Shows a sequence of LED screens as an animation.": "Shows a sequence of LED screens as an animation.",
"Starts a game countdown timer": "Starts a game countdown timer",
"Takes a screenshot of the LED screen and returns an image.": "Takes a screenshot of the LED screen and returns an image.",
"The pitch of the device, rotation along the ``x-axis``, in degrees.": "The pitch of the device, rotation along the ``x-axis``, in degrees.",
"Toggles a particular pixel": "Toggles a particular pixel",
"Turn off all LEDs": "Turn off all LEDs",
"Turn off the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.": "Turn off the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.",
"Turn on the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.": "Turn on the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.",
"Turns all LEDS on": "Turns all LEDS on",
"Writes a ``name: value`` pair line to the serial.": "Writes a ``name: value`` pair line to the serial.",
"Writes a value to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation. On a continuous rotation servo, this will set the speed of the servo (with ``0`` being full-speed in one direction, ``180`` being full speed in the other, and a value near ``90`` being no movement).": "Writes a value to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation. On a continuous rotation servo, this will set the speed of the servo (with ``0`` being full-speed in one direction, ``180`` being full speed in the other, and a value near ``90`` being no movement)."
}