Fix tutorial authoring for getting started (#885)
* Fix tutorial authoring for getting started Remove extra new lines * Fix other tutorials
This commit is contained in:
parent
d7f9280dc7
commit
2e9cb3c43b
@ -8,26 +8,6 @@ Fun games to build with your @boardname@.
|
|||||||
|
|
||||||
```codecard
|
```codecard
|
||||||
[{
|
[{
|
||||||
"name": "Flashing Heart",
|
|
||||||
"url":"/projects/flashing-heart",
|
|
||||||
"imageUrl": "/static/mb/projects/a1-display.png",
|
|
||||||
"cardType": "tutorial"
|
|
||||||
}, {
|
|
||||||
"name": "Smiley Buttons",
|
|
||||||
"url":"/projects/smiley-buttons",
|
|
||||||
"imageUrl": "/static/mb/projects/a2-buttons.png",
|
|
||||||
"cardType": "tutorial"
|
|
||||||
}, {
|
|
||||||
"name": "Coin Flipper",
|
|
||||||
"url":"/projects/coin-flipper",
|
|
||||||
"imageUrl": "/static/mb/projects/coin-flipper.png",
|
|
||||||
"cardType": "tutorial"
|
|
||||||
}, {
|
|
||||||
"name": "Love Meter",
|
|
||||||
"url":"/projects/love-meter",
|
|
||||||
"imageUrl":"/static/mb/projects/a3-pins.png",
|
|
||||||
"cardType": "tutorial"
|
|
||||||
}, {
|
|
||||||
"name": "Rock Paper Scissors",
|
"name": "Rock Paper Scissors",
|
||||||
"url":"/projects/rock-paper-scissors",
|
"url":"/projects/rock-paper-scissors",
|
||||||
"imageUrl":"/static/mb/projects/a4-motion.png"
|
"imageUrl":"/static/mb/projects/a4-motion.png"
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
## Step 1
|
## Step 1
|
||||||
|
|
||||||
Place a ``||input:on button pressed||`` block to run code
|
Place a ``||input:on button pressed||`` block to run code when button **A** is pressed.
|
||||||
when button **A** is pressed.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
## Step 1
|
## Step 1
|
||||||
|
|
||||||
Place the ``||basic:show leds||`` block in the ``||basic:on start||`` block
|
Place the ``||basic:show leds||`` block in the ``||basic:on start||`` block and draw a heart.
|
||||||
and draw a heart.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
basic.showLeds(`
|
basic.showLeds(`
|
||||||
|
@ -4,8 +4,7 @@ Make a love meter, how sweet! The @boardname@ is feeling the love, then sometime
|
|||||||
|
|
||||||
## Step 1
|
## Step 1
|
||||||
|
|
||||||
Let's build a **LOVE METER** machine. Place a ``||input:on pin pressed||`` block to run code
|
Let's build a **LOVE METER** machine. Place a ``||input:on pin pressed||`` block to run code when pin ``P0`` is pressed.
|
||||||
when pin ``P0`` is pressed.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onPinPressed(TouchPin.P0, () => {
|
input.onPinPressed(TouchPin.P0, () => {
|
||||||
@ -13,8 +12,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
|||||||
```
|
```
|
||||||
## Step 2
|
## Step 2
|
||||||
|
|
||||||
Using ``||basic:show number||`` and ``||Math:pick random||`` blocks,
|
Using ``||basic:show number||`` and ``||Math:pick random||`` blocks, show a random number from 0 to 100 when pin ``P0`` is pressed.
|
||||||
show a random number from 0 to 100 when pin ``P0`` is pressed.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onPinPressed(TouchPin.P0, () => {
|
input.onPinPressed(TouchPin.P0, () => {
|
||||||
|
@ -11,8 +11,7 @@ input.onButtonPressed(Button.A, () => {
|
|||||||
|
|
||||||
## Step 2
|
## Step 2
|
||||||
|
|
||||||
Place a ``||basic:show leds||`` block inside ``||input:on button pressed||``
|
Place a ``||basic:show leds||`` block inside ``||input:on button pressed||`` to display a smiley on the screen.
|
||||||
to display a smiley on the screen.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
@ -32,8 +31,7 @@ Click ``|Download|`` to transfer your code in your @boardname@ and try pressing
|
|||||||
|
|
||||||
## Step 4
|
## Step 4
|
||||||
|
|
||||||
Add ``||input:on button pressed||`` and ``||basic:show leds||`` blocks to
|
Add ``||input:on button pressed||`` and ``||basic:show leds||`` blocks to display a frowney when button **B** is pressed.
|
||||||
display a frowney when button **B** is pressed.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onButtonPressed(Button.B, () => {
|
input.onButtonPressed(Button.B, () => {
|
||||||
@ -53,8 +51,7 @@ Click ``|Download|`` to transfer your code in your @boardname@ and try pressing
|
|||||||
|
|
||||||
## Step 6
|
## Step 6
|
||||||
|
|
||||||
Add a secret mode where ``A`` and ``B`` are pressed together.
|
Add a secret mode where ``A`` and ``B`` are pressed together. In that case, add multiple ``||basic:show leds||`` blocks to create an animation...
|
||||||
In that case, add multiple ``||basic:show leds||`` blocks to create an animation...
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onButtonPressed(Button.AB, () => {
|
input.onButtonPressed(Button.AB, () => {
|
||||||
|
@ -13,4 +13,30 @@ Here are some cool tutorials to get you started with your @boardname@!
|
|||||||
"labelClass": "red ribbon large tutorial",
|
"labelClass": "red ribbon large tutorial",
|
||||||
"description": "Start coding your micro:bit with this simple tutorial."
|
"description": "Start coding your micro:bit with this simple tutorial."
|
||||||
}]
|
}]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Basic
|
||||||
|
|
||||||
|
```codecard
|
||||||
|
[{
|
||||||
|
"name": "Flashing Heart",
|
||||||
|
"url":"/projects/flashing-heart",
|
||||||
|
"imageUrl": "/static/mb/projects/a1-display.png",
|
||||||
|
"cardType": "tutorial"
|
||||||
|
}, {
|
||||||
|
"name": "Smiley Buttons",
|
||||||
|
"url":"/projects/smiley-buttons",
|
||||||
|
"imageUrl": "/static/mb/projects/a2-buttons.png",
|
||||||
|
"cardType": "tutorial"
|
||||||
|
}, {
|
||||||
|
"name": "Coin Flipper",
|
||||||
|
"url":"/projects/coin-flipper",
|
||||||
|
"imageUrl": "/static/mb/projects/coin-flipper.png",
|
||||||
|
"cardType": "tutorial"
|
||||||
|
}, {
|
||||||
|
"name": "Love Meter",
|
||||||
|
"url":"/projects/love-meter",
|
||||||
|
"imageUrl":"/static/mb/projects/a3-pins.png",
|
||||||
|
"cardType": "tutorial"
|
||||||
|
}]
|
||||||
```
|
```
|
@ -48,13 +48,11 @@ input.onButtonPressed(Button.B, () => {
|
|||||||
|
|
||||||
## Step 6
|
## Step 6
|
||||||
|
|
||||||
Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks
|
Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks in an ``||input:on shake||`` slot to build a dice.
|
||||||
in an ``||input:on shake||`` slot to build a dice.
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
When the @boardname@ is shaken, a random number between ``0`` and ``6`` is displayed
|
When the @boardname@ is shaken, a random number between ``0`` and ``6`` is displayed on the screen.
|
||||||
on the screen.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onGesture(Gesture.Shake, () => {
|
input.onGesture(Gesture.Shake, () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user