Tutorial format and macro fixes (#425)
* Tutorial format and macro fixes * Remove branded names
This commit is contained in:
parent
b1958d77e7
commit
ac81067f82
@ -6,6 +6,15 @@
|
|||||||
* [Try](/getting-started/try)
|
* [Try](/getting-started/try)
|
||||||
* [Use](/getting-started/use)
|
* [Use](/getting-started/use)
|
||||||
|
|
||||||
|
* [Tutorials](/tutorials)
|
||||||
|
* [Wake Up!](/tutorials/wake-up)
|
||||||
|
* [Make An Animation](/tutorials/make-an-animation)
|
||||||
|
* [What Animal Am I?](/tutorials/what-animal-am-i)
|
||||||
|
* [Music Brick](/tutorials/mindstorms-music)
|
||||||
|
* [Run Motors](/tutorials/run-motors)
|
||||||
|
* [Touch to Run](/tutorials/touch-to-run)
|
||||||
|
* [Touch Sensor Values](/tutorials/touch-sensor-values)
|
||||||
|
|
||||||
* [Coding](/coding)
|
* [Coding](/coding)
|
||||||
* [Autonomous Parking](/coding/autonomous-parking)
|
* [Autonomous Parking](/coding/autonomous-parking)
|
||||||
* [Object Detection](/coding/object-detection)
|
* [Object Detection](/coding/object-detection)
|
||||||
|
@ -2,19 +2,19 @@
|
|||||||
|
|
||||||
## Tutorials
|
## Tutorials
|
||||||
|
|
||||||
Step by step guide to coding your @boardname@.
|
Step by step guides to coding your @boardname@.
|
||||||
|
|
||||||
|
|
||||||
```codecard
|
```codecard
|
||||||
[{
|
[{
|
||||||
"name": "Wake Up Mindstorms",
|
"name": "Wake Up!",
|
||||||
"description": "Show different moods on your LEGO Mindstorms Brick. Is it tired, sleepy, or awake?",
|
"description": "Show different moods on your @boardname@. Is it tired, sleepy, or awake?",
|
||||||
"cardType": "tutorial",
|
"cardType": "tutorial",
|
||||||
"url":"/tutorials/wake-up",
|
"url":"/tutorials/wake-up",
|
||||||
"imageUrl":"/static/tutorials/wake-up.png"
|
"imageUrl":"/static/tutorials/wake-up.png"
|
||||||
}, {
|
}, {
|
||||||
"name": "Make An Animation",
|
"name": "Make An Animation",
|
||||||
"description": "Create a custom animation for your LEGO Mindstorms Brick.",
|
"description": "Create a custom animation for your @boardname@.",
|
||||||
"cardType": "tutorial",
|
"cardType": "tutorial",
|
||||||
"url":"/tutorials/make-an-animation",
|
"url":"/tutorials/make-an-animation",
|
||||||
"imageUrl":"/static/tutorials/make-an-animation.png"
|
"imageUrl":"/static/tutorials/make-an-animation.png"
|
||||||
@ -25,8 +25,8 @@ Step by step guide to coding your @boardname@.
|
|||||||
"url":"/tutorials/what-animal-am-i",
|
"url":"/tutorials/what-animal-am-i",
|
||||||
"imageUrl":"/static/tutorials/what-animal-am-i.png"
|
"imageUrl":"/static/tutorials/what-animal-am-i.png"
|
||||||
}, {
|
}, {
|
||||||
"name": "Mindstorms Music",
|
"name": "Music Brick",
|
||||||
"description": "Transform your LEGO Mindstorms Brick into a musical instrument!",
|
"description": "Transform your @boardname@ into a musical instrument!",
|
||||||
"cardType": "tutorial",
|
"cardType": "tutorial",
|
||||||
"url":"/tutorials/mindstorms-music",
|
"url":"/tutorials/mindstorms-music",
|
||||||
"imageUrl":"/static/tutorials/mindstorms-music.png"
|
"imageUrl":"/static/tutorials/mindstorms-music.png"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Introduction @fullscreen
|
## Introduction @fullscreen
|
||||||
|
|
||||||
Create a custom animation for your LEGO Mindstorms Brick.
|
Create a custom animation for your @boardname@.
|
||||||
|
|
||||||
![Button press on brick](/static/tutorials/make-an-animation/button-pressed.gif)
|
![Button press on brick](/static/tutorials/make-an-animation/button-pressed.gif)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ brick.showString("Hello world", 1)
|
|||||||
|
|
||||||
In the ``||brick:show string||`` block, type the text ``"Press my button"`` to replace ``"Hello world"``.
|
In the ``||brick:show string||`` block, type the text ``"Press my button"`` to replace ``"Hello world"``.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showString("Press my button!", 1)
|
brick.showString("Press my button!", 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ brick.showString("Press my button!", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out an ``||brick:on button||`` block onto anyplace in the Workspace.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out an ``||brick:on button||`` block onto anyplace in the Workspace.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -37,7 +37,7 @@ brick.showString("Press my button!", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out a ``||brick:show image||`` block onto the Workspace, and drop it into the ``||brick:on button||`` block.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out a ``||brick:show image||`` block onto the Workspace, and drop it into the ``||brick:on button||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
brick.showImage(images.expressionsBigSmile)
|
brick.showImage(images.expressionsBigSmile)
|
||||||
})
|
})
|
||||||
@ -48,7 +48,7 @@ brick.showString("Press my button!", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out a ``||brick:set status light||`` block onto the Workspace, and drop it into the ``||brick:on button||`` block after the ``||brick:show image||`` block.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out a ``||brick:set status light||`` block onto the Workspace, and drop it into the ``||brick:on button||`` block after the ``||brick:show image||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
brick.showImage(images.expressionsBigSmile)
|
brick.showImage(images.expressionsBigSmile)
|
||||||
brick.setStatusLight(StatusLight.Orange)
|
brick.setStatusLight(StatusLight.Orange)
|
||||||
@ -58,4 +58,4 @@ brick.showString("Press my button!", 1)
|
|||||||
|
|
||||||
## Step 6
|
## Step 6
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick.
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Mindstorms Music
|
# Music Brick
|
||||||
|
|
||||||
## Introduction @fullscreen
|
## Introduction @fullscreen
|
||||||
|
|
||||||
Transform your LEGO Mindstorms Brick into a musical instrument!
|
Transform your @boardname@ into a musical instrument!
|
||||||
|
|
||||||
![Press my buttons message](/static/tutorials/mindstorms-music/press-my-buttons.png)
|
![Press my buttons message](/static/tutorials/mindstorms-music/press-my-buttons.png)
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ Transform your LEGO Mindstorms Brick into a musical instrument!
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. From the **Screen** section, drag out a ``||brick:show string||`` block onto the Workspace, and drop it into the ``||loops:on start||`` block. You should hear and see the block click into place.
|
Open the ``||brick:Brick||`` Toolbox drawer. From the **Screen** section, drag out a ``||brick:show string||`` block onto the Workspace, and drop it into the ``||loops:on start||`` block. You should hear and see the block click into place.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showString("Hello world", 1)
|
brick.showString("Hello world", 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ brick.showString("Hello world", 1)
|
|||||||
|
|
||||||
In the ``||brick:show string||`` block, type the text ``"Press my buttons to make music!"`` to replace ``"Hello world"``.
|
In the ``||brick:show string||`` block, type the text ``"Press my buttons to make music!"`` to replace ``"Hello world"``.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showString("Press my buttons to make music!", 1)
|
brick.showString("Press my buttons to make music!", 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ brick.showString("Press my buttons to make music!", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out an ``||brick:on button||`` block onto the Workspace (you can put it anywhere).
|
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out an ``||brick:on button||`` block onto the Workspace (you can put it anywhere).
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -38,7 +38,7 @@ brick.showString("Press my buttons to make music!", 1)
|
|||||||
|
|
||||||
Open the ``||music:Music||`` Toolbox drawer. Drag out **5** ``||music:play tone||`` blocks onto the Workspace, and drop them into the ``||brick:on button||`` block. **Note:** you can also right-click on a block and select "Duplicate" to copy blocks.
|
Open the ``||music:Music||`` Toolbox drawer. Drag out **5** ``||music:play tone||`` blocks onto the Workspace, and drop them into the ``||brick:on button||`` block. **Note:** you can also right-click on a block and select "Duplicate" to copy blocks.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
music.playTone(0, music.beat(BeatFraction.Half))
|
music.playTone(0, music.beat(BeatFraction.Half))
|
||||||
music.playTone(0, music.beat(BeatFraction.Half))
|
music.playTone(0, music.beat(BeatFraction.Half))
|
||||||
@ -55,7 +55,7 @@ In the ``||music:play tone||`` blocks, use the drop-down menu to select a note t
|
|||||||
|
|
||||||
![Tone selector keyboard](/static/tutorials/mindstorms-music/play-tone-dropdown.png)
|
![Tone selector keyboard](/static/tutorials/mindstorms-music/play-tone-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
music.playTone(440, music.beat(BeatFraction.Half))
|
music.playTone(440, music.beat(BeatFraction.Half))
|
||||||
music.playTone(494, music.beat(BeatFraction.Half))
|
music.playTone(494, music.beat(BeatFraction.Half))
|
||||||
@ -68,5 +68,5 @@ brick.showString("Press my buttons to make music!", 1)
|
|||||||
|
|
||||||
## Step 6
|
## Step 6
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. You can add more ``||brick:on button||`` blocks to the Workspace and create other ``||music:play tone||`` melodies when different buttons are pressed to transform your Mindstorms brick into a musical instrument!
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. You can add more ``||brick:on button||`` blocks to the Workspace and create other ``||music:play tone||`` melodies when different buttons are pressed to transform your brick into a musical instrument!
|
||||||
|
|
@ -10,7 +10,7 @@ Use the buttons to start and stop the large and medium motors.
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out **2** ``||brick:on button||`` blocks onto the Workspace (you can place these anywhere on the Workspace).
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out **2** ``||brick:on button||`` blocks onto the Workspace (you can place these anywhere on the Workspace).
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -25,7 +25,7 @@ In the ``||brick:on button||`` blocks, use the drop-down menu to select the ``up
|
|||||||
|
|
||||||
![Button dropdown selection](/static/tutorials/run-motors/on-button-dropdown.png)
|
![Button dropdown selection](/static/tutorials/run-motors/on-button-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -38,7 +38,7 @@ brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out **2** ``||motors:run||`` blocks onto the Workspace, and drop one of them each into the ``||brick:on button||`` blocks.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out **2** ``||motors:run||`` blocks onto the Workspace, and drop one of them each into the ``||brick:on button||`` blocks.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -55,7 +55,7 @@ In the Run block that is in the On Button Down pressed block, change the speed v
|
|||||||
|
|
||||||
![Motor speed select field](/static/tutorials/run-motors/run-speed-field.png)
|
![Motor speed select field](/static/tutorials/run-motors/run-speed-field.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -69,7 +69,7 @@ brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
Now, let’s add a Medium motor, and specify how many rotations we want the motor to run for.
|
Now, let’s add a Medium motor, and specify how many rotations we want the motor to run for.
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out **2** ``|brick:on button||`` blocks onto the Workspace. In the ``||brick:on button||`` blocks, use the drop-down menu to select the ``left`` and ``right`` buttons.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out **2** ``|brick:on button||`` blocks onto the Workspace. In the ``||brick:on button||`` blocks, use the drop-down menu to select the ``left`` and ``right`` buttons.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -88,7 +88,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out **2** ``||motors:run||`` blocks onto the Workspace, and drop one of them each into the ``||brick:on button left||`` and ``||brick:on button right||`` blocks.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out **2** ``||motors:run||`` blocks onto the Workspace, and drop one of them each into the ``||brick:on button left||`` and ``||brick:on button right||`` blocks.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -109,7 +109,7 @@ For the ``||motors:run||`` blocks that are in the ``||brick:on button left||`` a
|
|||||||
|
|
||||||
![Select motor on a port dropdown](/static/tutorials/run-motors/run-motor-dropdown.png)
|
![Select motor on a port dropdown](/static/tutorials/run-motors/run-motor-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -128,7 +128,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
In the ``||motors:run medium motor||`` blocks, click on the plus icon **(+)** to expand the blocks. Change the number of rotations from `0` to `5`.
|
In the ``||motors:run medium motor||`` blocks, click on the plus icon **(+)** to expand the blocks. Change the number of rotations from `0` to `5`.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -147,7 +147,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Let’s also change the speed that our Medium motors are running at. In the ``||motors:run medium motor||`` block that is in the ``||brick:on button left||`` block, change the speed from ``50%`` to ``10%``.
|
Let’s also change the speed that our Medium motors are running at. In the ``||motors:run medium motor||`` block that is in the ``||brick:on button left||`` block, change the speed from ``50%`` to ``10%``.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -166,7 +166,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
In the ``||motors:run medium motor||`` block that is in the ``||brick:on button right||`` block, change the speed from ``50%`` to ``100%``.
|
In the ``||motors:run medium motor||`` block that is in the ``||brick:on button right||`` block, change the speed from ``50%`` to ``100%``.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -185,7 +185,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Finally, let’s add a way to stop all our motors from running. Open the ``||brick:Brick||`` Toolbox drawer. Drag out an ``||brick:on button||`` block onto the Workspace.
|
Finally, let’s add a way to stop all our motors from running. Open the ``||brick:Brick||`` Toolbox drawer. Drag out an ``||brick:on button||`` block onto the Workspace.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -207,7 +207,7 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop all motors||`` block onto the Workspace, and drop into the ``||brick:on button||`` enter block.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop all motors||`` block onto the Workspace, and drop into the ``||brick:on button||`` enter block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -227,4 +227,4 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
## Step 13
|
## Step 13
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Attach a Large motor to Port A, and a Medium motor to Port D. Then test your program by pressing the different buttons to see whether the correct motors are running as expected.
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Attach a Large motor to Port A, and a Medium motor to Port D. Test your program by pressing the different buttons to see whether the correct motors are running as expected.
|
||||||
|
@ -10,7 +10,7 @@ Use the Touch sensor value to stop a running motor.
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag an ``||brick:on button||`` block onto the Workspace, and place it anywhere on the Workspace.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag an ``||brick:on button||`` block onto the Workspace, and place it anywhere on the Workspace.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -20,7 +20,7 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:run||`` block onto the Workspace, and drop it into the ``||brick:on button||`` block.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:run||`` block onto the Workspace, and drop it into the ``||brick:on button||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -30,7 +30,7 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
|
|
||||||
Open the ``||logic:Logic||`` Toolbox drawer. Drag out an ``||logic:if then||`` block onto the Workspace, and drop it into the ``||loops:forever||`` block.
|
Open the ``||logic:Logic||`` Toolbox drawer. Drag out an ``||logic:if then||`` block onto the Workspace, and drop it into the ``||loops:forever||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
if (true) {
|
if (true) {
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ forever(function () {
|
|||||||
|
|
||||||
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out a ``||sensors:touch is pressed||`` block onto the Workspace, and drop it in the ``||logic:if then||`` block replacing ``true``.
|
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out a ``||sensors:touch is pressed||`` block onto the Workspace, and drop it in the ``||logic:if then||`` block replacing ``true``.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
if (sensors.touch1.isPressed()) {
|
if (sensors.touch1.isPressed()) {
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ forever(function () {
|
|||||||
|
|
||||||
Open the ``||music:Music||`` Toolbox drawer. Drag out a ``||music:play sound effect||`` block onto the Workspace, and drop it under the ``||logic:if then||`` block.
|
Open the ``||music:Music||`` Toolbox drawer. Drag out a ``||music:play sound effect||`` block onto the Workspace, and drop it under the ``||logic:if then||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
if (sensors.touch1.isPressed()) {
|
if (sensors.touch1.isPressed()) {
|
||||||
music.playSoundEffect(sounds.animalsCatPurr)
|
music.playSoundEffect(sounds.animalsCatPurr)
|
||||||
@ -66,7 +66,7 @@ forever(function () {
|
|||||||
|
|
||||||
In the ``||music:play sound effect||`` block, use the drop-down menu to select the ``information touch`` sound effect.
|
In the ``||music:play sound effect||`` block, use the drop-down menu to select the ``information touch`` sound effect.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
if (sensors.touch1.isPressed()) {
|
if (sensors.touch1.isPressed()) {
|
||||||
music.playSoundEffect(sounds.informationTouch)
|
music.playSoundEffect(sounds.informationTouch)
|
||||||
@ -78,7 +78,7 @@ forever(function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop||`` block onto the Workspace, and drop it in after the ``||music:play sound effect||`` block.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop||`` block onto the Workspace, and drop it in after the ``||music:play sound effect||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
forever(function () {
|
forever(function () {
|
||||||
if (sensors.touch1.isPressed()) {
|
if (sensors.touch1.isPressed()) {
|
||||||
music.playSoundEffect(sounds.informationTouch)
|
music.playSoundEffect(sounds.informationTouch)
|
||||||
@ -89,4 +89,4 @@ forever(function () {
|
|||||||
|
|
||||||
## Step 8
|
## Step 8
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Attach a Large motor to Port A, and a Touch sensor to Port 1 on your brick. Test your program by pressing the ENTER button. When the motor starts, press the touch sensor. Does the motor stop as expected?
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Attach a Large motor to Port A, and a Touch sensor to Port 1 on your brick. Test your program by pressing the ENTER button. When the motor starts, press the touch sensor. Does the motor stop as expected?
|
||||||
|
@ -10,7 +10,7 @@ Use the Touch sensor to run a motor.
|
|||||||
|
|
||||||
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out **2** ``||sensors:on touch||`` blocks onto the Workspace (you can place these anywhere).
|
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out **2** ``||sensors:on touch||`` blocks onto the Workspace (you can place these anywhere).
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -25,7 +25,7 @@ In one of the ``||sensors:on touch||`` blocks, use the second drop-down menu to
|
|||||||
|
|
||||||
![Touch sensor action dropdown](/static/tutorials/touch-to-run/on-touch-dropdown.png)
|
![Touch sensor action dropdown](/static/tutorials/touch-to-run/on-touch-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -38,7 +38,7 @@ sensors.touch1.onEvent(ButtonEvent.Released, function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:run||`` block onto the Workspace, and drop it into the ``||brick:on touch pressed||`` block.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:run||`` block onto the Workspace, and drop it into the ``||brick:on touch pressed||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -51,7 +51,7 @@ sensors.touch1.onEvent(ButtonEvent.Released, function () {
|
|||||||
|
|
||||||
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop||`` block onto the Workspace, and drop it into the ``||sensors:on touch released||`` block.
|
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop||`` block onto the Workspace, and drop it into the ``||sensors:on touch released||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
|
||||||
motors.largeA.run(50)
|
motors.largeA.run(50)
|
||||||
})
|
})
|
||||||
@ -62,4 +62,4 @@ sensors.touch1.onEvent(ButtonEvent.Released, function () {
|
|||||||
|
|
||||||
## Step 5
|
## Step 5
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Attach a Large motor to Port A, and a Touch sensor to Port 1 on your brick. Test your program by pressing and releasing the touch sensor – does the motor start and stop as expected?
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Attach a Large motor to Port A, and a Touch sensor to Port 1 on your brick. Test your program by pressing and releasing the touch sensor – does the motor start and stop as expected?
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Wake Up Mindstorms
|
# Wake Up!
|
||||||
|
|
||||||
## Introduction @fullscreen
|
## Introduction @fullscreen
|
||||||
|
|
||||||
Show different moods on your LEGO Mindstorms Brick.
|
Show different moods on your @boardname@.
|
||||||
|
|
||||||
![Show mood on the screen](/static/tutorials/wake-up/show-mood.gif)
|
![Show mood on the screen](/static/tutorials/wake-up/show-mood.gif)
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ Show different moods on your LEGO Mindstorms Brick.
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out a ``||brick:show mood||`` block onto the Workspace, and place it into the ``||loops:on start||`` block. You should hear and see the block click into place.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out a ``||brick:show mood||`` block onto the Workspace, and place it into the ``||loops:on start||`` block. You should hear and see the block click into place.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ brick.showMood(moods.sleeping)
|
|||||||
|
|
||||||
Notice your brick is snoring with eyes closed in the simulator! Let’s wake her up. Open the ``||brick:Brick||`` Toolbox drawer again. Drag out 2 more ``||brick:show mood||`` blocks onto the Workspace, and drop them into the ``||brick:on start||`` block also.
|
Notice your brick is snoring with eyes closed in the simulator! Let’s wake her up. Open the ``||brick:Brick||`` Toolbox drawer again. Drag out 2 more ``||brick:show mood||`` blocks onto the Workspace, and drop them into the ``||brick:on start||`` block also.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
@ -30,7 +30,7 @@ In the second ``||brick:show mood||`` block, click on the drop-down menu to sele
|
|||||||
|
|
||||||
![Show mood dropdown selections](/static/tutorials/wake-up/show-mood-dropdown-1.png)
|
![Show mood dropdown selections](/static/tutorials/wake-up/show-mood-dropdown-1.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
brick.showMood(moods.tired)
|
brick.showMood(moods.tired)
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
@ -42,7 +42,7 @@ In the third ``||brick:show mood||`` block, click on the drop-down menu to selec
|
|||||||
|
|
||||||
![Show mood dropdown selections](/static/tutorials/wake-up/show-mood-dropdown-2.png)
|
![Show mood dropdown selections](/static/tutorials/wake-up/show-mood-dropdown-2.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showMood(moods.sleeping)
|
brick.showMood(moods.sleeping)
|
||||||
brick.showMood(moods.tired)
|
brick.showMood(moods.tired)
|
||||||
brick.showMood(moods.love)
|
brick.showMood(moods.love)
|
||||||
@ -50,5 +50,5 @@ brick.showMood(moods.love)
|
|||||||
|
|
||||||
## Step 5
|
## Step 5
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick.
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick.
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Introduction @fullscreen
|
## Introduction @fullscreen
|
||||||
|
|
||||||
Create different animal effects with your LEGO Mindstorms Brick.
|
Create different animal effects with your @boardname@.
|
||||||
|
|
||||||
![Guess the what the animal is](/static/tutorials/what-animal-am-i/guess-animal.gif)
|
![Guess the what the animal is](/static/tutorials/what-animal-am-i/guess-animal.gif)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ brick.showString("Hello world", 1)
|
|||||||
|
|
||||||
In the ``||brick:show string||`` block, type the text ``"Guess what animal?"`` to replace ``"Hello world"``.
|
In the ``||brick:show string||`` block, type the text ``"Guess what animal?"`` to replace ``"Hello world"``.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.showString("Guess what animal?", 1)
|
brick.showString("Guess what animal?", 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ brick.showString("Guess what animal?", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out an ``||brick:on button||`` block and put it anywhere in the Workspace.
|
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out an ``||brick:on button||`` block and put it anywhere in the Workspace.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -39,7 +39,7 @@ In the ``||brick:on button||`` block, use the drop-down menu to select the ``lef
|
|||||||
|
|
||||||
![Dropdown with button choices](/static/tutorials/what-animal-am-i/on-button-dropdown.png)
|
![Dropdown with button choices](/static/tutorials/what-animal-am-i/on-button-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -50,7 +50,7 @@ brick.showString("Guess what animal?", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. In the **Buttons** section, drag out **3** more ``||brick:on button||`` blocks onto the Workspace. Using the drop-down menu, select the ``right``, ``up``, and ``down`` buttons for these 3 blocks.
|
Open the ``||brick:Brick||`` Toolbox drawer. In the **Buttons** section, drag out **3** more ``||brick:on button||`` blocks onto the Workspace. Using the drop-down menu, select the ``right``, ``up``, and ``down`` buttons for these 3 blocks.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -70,7 +70,7 @@ brick.showString("Guess what animal?", 1)
|
|||||||
|
|
||||||
Open the ``||brick:Brick||`` Toolbox drawer. Drag out **4** ``||brick:show image||`` blocks onto the Workspace, and drop one of them into each of the ``||brick:on button||`` blocks.
|
Open the ``||brick:Brick||`` Toolbox drawer. Drag out **4** ``||brick:show image||`` blocks onto the Workspace, and drop one of them into each of the ``||brick:on button||`` blocks.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
brick.showImage(images.expressionsBigSmile)
|
brick.showImage(images.expressionsBigSmile)
|
||||||
})
|
})
|
||||||
@ -92,7 +92,7 @@ In the ``||brick:show image||`` blocks, use the drop-down menu to select a diffe
|
|||||||
|
|
||||||
![Dropdown with image selection](/static/tutorials/what-animal-am-i/show-image-dropdown.png)
|
![Dropdown with image selection](/static/tutorials/what-animal-am-i/show-image-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
brick.showImage(images.expressionsMouth2shut)
|
brick.showImage(images.expressionsMouth2shut)
|
||||||
})
|
})
|
||||||
@ -112,7 +112,7 @@ brick.showString("Guess what animal?", 0)
|
|||||||
|
|
||||||
Open the ``||music:Music||`` Toolbox drawer. Drag out **4** ``||music:play sound effect||`` blocks onto the Workspace, and drop one of them into each of the ``||brick:on button||`` blocks, just after the ``||brick:show image||`` block.
|
Open the ``||music:Music||`` Toolbox drawer. Drag out **4** ``||music:play sound effect||`` blocks onto the Workspace, and drop one of them into each of the ``||brick:on button||`` blocks, just after the ``||brick:show image||`` block.
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
brick.showImage(images.expressionsMouth2shut)
|
brick.showImage(images.expressionsMouth2shut)
|
||||||
music.playSoundEffect(sounds.animalsCatPurr)
|
music.playSoundEffect(sounds.animalsCatPurr)
|
||||||
@ -138,7 +138,7 @@ In each ``||music:play sound effect||`` block, use the drop-down menu to select
|
|||||||
|
|
||||||
![Dropdown with sound effect selection](/static/tutorials/what-animal-am-i/play-sound-effect-dropdown.png)
|
![Dropdown with sound effect selection](/static/tutorials/what-animal-am-i/play-sound-effect-dropdown.png)
|
||||||
|
|
||||||
```block
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
brick.showImage(images.expressionsMouth2shut)
|
brick.showImage(images.expressionsMouth2shut)
|
||||||
music.playSoundEffect(sounds.animalsCatPurr)
|
music.playSoundEffect(sounds.animalsCatPurr)
|
||||||
@ -160,4 +160,4 @@ brick.showString("Guess what animal?", 0)
|
|||||||
|
|
||||||
## Step 10
|
## Step 10
|
||||||
|
|
||||||
Now, let’s download our program to the brick. Plug your EV3 brick into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Test your program with a friend by pressing the right, left, up, and down buttons on your Brick. Have your friend guess what animal it is!
|
Now, let’s download our program to the brick. Plug your @boardname@ into the computer with the USB cable, and click the blue **Download** button in the bottom left of your screen. Follow the directions to save your program to the brick. Test your program with a friend by pressing the right, left, up, and down buttons on your brick. Have your friend guess what animal it is!
|
||||||
|
Loading…
Reference in New Issue
Block a user