diff --git a/docs/reference/basic.md b/docs/reference/basic.md index 461e1a63..de3627c8 100644 --- a/docs/reference/basic.md +++ b/docs/reference/basic.md @@ -2,7 +2,6 @@ Provides access to basic micro:bit functionality. - ```cards basic.showNumber(0); basic.showLeds(` diff --git a/docs/reference/control.md b/docs/reference/control.md index 652d1224..6fa4752f 100644 --- a/docs/reference/control.md +++ b/docs/reference/control.md @@ -1,7 +1,6 @@ # Control - - +Runtime and event utilities. ```cards control.inBackground(() => { diff --git a/docs/reference/game.md b/docs/reference/game.md index eaf9ddc2..17007641 100644 --- a/docs/reference/game.md +++ b/docs/reference/game.md @@ -1,7 +1,6 @@ # Game - - +A single-LED sprite game engine ```cards game.addScore(1); diff --git a/docs/reference/images.md b/docs/reference/images.md index d6f91ab2..fba69662 100644 --- a/docs/reference/images.md +++ b/docs/reference/images.md @@ -1,7 +1,6 @@ # Images - - +Creation, manipulation and display of LED images. ```cards images.createImage(` diff --git a/docs/reference/input.md b/docs/reference/input.md index 31a6bfd8..bd045b28 100644 --- a/docs/reference/input.md +++ b/docs/reference/input.md @@ -1,7 +1,6 @@ # Input - - +Events and data from sensors ```cards input.onButtonPressed(Button.A, () => { diff --git a/docs/reference/led.md b/docs/reference/led.md index 1cc520e3..15c5c06e 100644 --- a/docs/reference/led.md +++ b/docs/reference/led.md @@ -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(); diff --git a/docs/reference/music.md b/docs/reference/music.md index d91ad13b..29d27c1c 100644 --- a/docs/reference/music.md +++ b/docs/reference/music.md @@ -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); diff --git a/docs/reference/pins.md b/docs/reference/pins.md index fd9ee0ab..7f7f2c36 100644 --- a/docs/reference/pins.md +++ b/docs/reference/pins.md @@ -1,7 +1,6 @@ # Pins - - +Control currents in Pins for analog/digital signals, servos, i2c, ... ```cards pins.digitalReadPin(DigitalPin.P0); diff --git a/docs/reference/serial.md b/docs/reference/serial.md index 24c47b69..e4a373d0 100644 --- a/docs/reference/serial.md +++ b/docs/reference/serial.md @@ -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); ``` diff --git a/libs/microbit/strings.json b/libs/microbit/strings.json new file mode 100644 index 00000000..44753cd8 --- /dev/null +++ b/libs/microbit/strings.json @@ -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)." +} \ No newline at end of file