From 325ccce3a0890979574693ce26b4681689fdfc8c Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 18 Aug 2017 08:34:01 -0700 Subject: [PATCH] Docsfix2 (#510) * missing packages * fixing snippet issues * snippet fix * more doc fixes --- docs/courses/csintro/algorithms/activity.md | 27 ++++--- docs/courses/csintro/booleans/project.md | 79 +++++++++++---------- docs/device/serial.md | 2 +- docs/examples/radio-dashboard.md | 4 ++ docs/projects/hot-or-cold.md | 4 ++ docs/projects/plant-watering.md | 1 - docs/projects/plant-watering/code.md | 4 ++ docs/projects/voting-machine.md | 4 ++ 8 files changed, 70 insertions(+), 55 deletions(-) diff --git a/docs/courses/csintro/algorithms/activity.md b/docs/courses/csintro/algorithms/activity.md index 45d4fa84..dc394691 100644 --- a/docs/courses/csintro/algorithms/activity.md +++ b/docs/courses/csintro/algorithms/activity.md @@ -100,22 +100,21 @@ Now we can use our LED lights to display different images depending on what butt ```blocks input.onButtonPressed(Button.A, () => { -   basic.showLeds(` -       . . . . . -       . . . . . -       . . . . . -       . . . . . -       . . . . . -       `) + basic.showLeds(`. . . . . + . . . . . + . . . . . + . . . . . + . . . . . + `) }) input.onButtonPressed(Button.B, () => { -   basic.showLeds(` -       . . . . . -       . . . . . -       . . . . . -       . . . . . -       . . . . . -       `) + basic.showLeds(` + . . . . . + . . . . . + . . . . . + . . . . . + . . . . . + `) }) ``` * Click on the individual little boxes in the ‘show leds’ block that is in the ‘on button A pressed’ event handler to create the image of a happy face. diff --git a/docs/courses/csintro/booleans/project.md b/docs/courses/csintro/booleans/project.md index 120fce50..26f85550 100644 --- a/docs/courses/csintro/booleans/project.md +++ b/docs/courses/csintro/booleans/project.md @@ -23,145 +23,145 @@ https://youtu.be/VmD-dcZZQFc ```blocks input.onButtonPressed(Button.B, () => { if (128 > input.lightLevel() && 0 < input.lightLevel() && input.temperature() > 22) { - basic.showAnimation(` + basic.showLeds(` . # . # . # . . . # . . . . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . # # # . # . . . # . . . . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . # # # . # . . . # . # . # . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . # # # . # . . . # . # # # . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . . . . . # . # . . . . . . . # # # . # . . . # - `, 500) + `) } else { - basic.showAnimation(` + basic.showLeds(` # . . . . . . . . . . . . . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . # . . . # # . . . . . . . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . # . . . . # . . # # # . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . # # . . . # . . # # # . . # . . # . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . # # # . . # . . # # # . . # . . # . # . . . # - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . . . . . # . # . . . . . . # . . . # . # # # . - `, 500) + `) } }) input.onButtonPressed(Button.A, () => { if (input.temperature() < 22 && input.temperature() > 6) { - basic.showAnimation(` + basic.showLeds(` . . . . . . . . . . . . # . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . . . . . . # . . . # # # . . . # . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . . . . . . . . . . . . . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` # # # # # # # # # # # # # # # # # # # # # # # # # - `, 500) + `) } else { - basic.showAnimation(` + basic.showLeds(` . . . . . . . . . . . . # . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . . . . . . . . . . # # # . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` . . . . . . . . . . . . . . . . . . . . . . . . . - `, 500) -basic.showAnimation(` + `) +basic.showLeds(` # # # # # # . . . # # . . . # # . . . # # # # # # - `, 500) + `) } }) input.onGesture(Gesture.Shake, () => { @@ -303,8 +303,9 @@ This is an example of a board game in which the micro:bit displays an arrow poin Here is a portion of the board game's code. A boolean variable is used to determine whose turn it is. If player1Turn is false, then it's player 2's turn. A random number is generated to show the arrow seventy-five percent of the time (for values of 0, 1, or 2). ```blocks +let player1Turn = false; input.onGesture(Gesture.Shake, () => { -if (player1Turn == true && Math.random(4) < 3) { + if (player1Turn == true && Math.random(4) < 3) { } }) diff --git a/docs/device/serial.md b/docs/device/serial.md index cfcc965f..c7dc501f 100644 --- a/docs/device/serial.md +++ b/docs/device/serial.md @@ -108,7 +108,7 @@ You can use the ``chromeserial=CHROMEID`` query argument to load your own Chrome * the editor will try to connect a port named ``serial`` ([source](https://github.com/Microsoft/pxt-microbit/blob/master/clients/chrome/background.ts#L73)) * data can be sent back to the editor as JSON payloads ([source](https://github.com/Microsoft/pxt-microbit/blob/master/clients/chrome/background.ts#L42)) -```typescript +```typescript-ignore port.postMessage({ type: "serial", data: decodedString, diff --git a/docs/examples/radio-dashboard.md b/docs/examples/radio-dashboard.md index ae159d2d..dc296e4c 100644 --- a/docs/examples/radio-dashboard.md +++ b/docs/examples/radio-dashboard.md @@ -82,4 +82,8 @@ basic.forever(() => { // setup the radio and start! radio.setGroup(4) game.addScore(1) +``` + +```package +radio ``` \ No newline at end of file diff --git a/docs/projects/hot-or-cold.md b/docs/projects/hot-or-cold.md index 549b6489..22e51dc2 100644 --- a/docs/projects/hot-or-cold.md +++ b/docs/projects/hot-or-cold.md @@ -163,3 +163,7 @@ input.onButtonPressed(Button.A, () => { }) radio.setGroup(1) ``` + +```package +radio +``` \ No newline at end of file diff --git a/docs/projects/plant-watering.md b/docs/projects/plant-watering.md index 3132e07e..a5bb757a 100644 --- a/docs/projects/plant-watering.md +++ b/docs/projects/plant-watering.md @@ -31,7 +31,6 @@ This is a follow up of the **[soil moisture project](/projects/soil-moisture)**. * [Make](/projects/plant-watering/make) * [Code](/projects/plant-watering/code) -* [Connect](/projects/plant-watering/connect) ### ~button /projects/plant-watering/make diff --git a/docs/projects/plant-watering/code.md b/docs/projects/plant-watering/code.md index aaf9cb45..8e9bbf64 100644 --- a/docs/projects/plant-watering/code.md +++ b/docs/projects/plant-watering/code.md @@ -57,3 +57,7 @@ basic.forever(() => { ``` https://youtu.be/7eC_VjH1eP0 + +```package +radio +``` \ No newline at end of file diff --git a/docs/projects/voting-machine.md b/docs/projects/voting-machine.md index 2066d43b..32c2f9a8 100644 --- a/docs/projects/voting-machine.md +++ b/docs/projects/voting-machine.md @@ -74,3 +74,7 @@ and uses the number received as the brightness of the LED. When a message hasn't been received by a board for some time, it's pixel will start to blink. After more time, it will simply turn off. + +```package +radio +```