Compare commits

...

50 Commits

Author SHA1 Message Date
51cb7a5299 0.3.2 2018-06-14 13:56:45 -04:00
068eb7017f pxt.commands null check 2018-06-14 13:40:19 -04:00
bb4966dca7 Bump pxt-core to 3.19.4 + Support drive deploy in Electron offline app (#677)
* initial

* Bump pxt-core to 3.19.4 for drive deploy
2018-06-14 13:33:53 -04:00
e981d1b95d Release patch fix with copyright text change (#680) 2018-06-13 16:11:52 -07:00
4f91d992a5 0.3.1 2018-06-13 14:49:52 -07:00
c91bf3ea7c Move master to v0.3 2018-06-13 14:49:24 -07:00
c6f92aa1cb Update footer as a product of docupdates (#678) 2018-06-13 11:34:26 -07:00
5de5b64e61 Edits from LEGO team review (#676) 2018-06-12 06:46:44 -07:00
1d442b7de9 Fix piano field editor (when it's on its own) (#675) 2018-06-07 16:42:49 -07:00
8508d5e8ba converting try into tutorial 2018-06-07 07:00:12 -07:00
f04a76a95f 0.1.62 2018-06-07 00:28:51 -07:00
88969da972 bump pxt-core to 3.18.17, bump pxt-common-packages to 0.23.15, 2018-06-07 00:28:45 -07:00
b19e5c4e4b Releasing app v0.1.60 2018-06-06 13:36:46 -04:00
15caad8b02 0.1.61 2018-06-01 09:04:15 -07:00
22ce6a8716 bump to pxt 3.18.10 (#671) 2018-06-01 09:03:47 -07:00
c288242b9c add "pause on run" flag to disable waiting after command (#663)
* add "pause on run" flag to disable waiting after command

* refactor

* fixing build
2018-06-01 08:51:50 -07:00
a8249e94c5 Make the troubleshoot menu item pop out into a new tab (#670) 2018-05-31 13:42:37 -07:00
92fbc1552b 0.1.60 2018-05-31 10:19:14 -07:00
92f29ef5d6 bump pxt-common-packages to 0.23.8, 2018-05-31 10:19:08 -07:00
c7fabfd994 0.1.59 2018-05-31 10:16:04 -07:00
df49475a26 bump pxt-core to 3.18.9, 2018-05-31 10:15:58 -07:00
17d8e61ebc 0.1.58 2018-05-31 10:13:17 -07:00
dbdc1810cd Add copyright text (#667) 2018-05-30 15:42:37 -07:00
d3b7530b17 EV3 Brick terminology (#665)
* reprhased

* EV3 brick => EV3 Brick

* revert a change
2018-05-30 15:42:17 -07:00
e31f4c934f Update README.md 2018-05-29 11:04:22 -07:00
b22ec74f7e Tshoot page edits (#658)
* T-shoot page edits post revert

* Restyle link

* Merge in revert page

* Clarify brick info step

* Keep periods off simple steps this time
2018-05-23 16:25:05 -07:00
cd38f670d2 T shoot page revert (#657)
* T-shoot page edits

* Revert t-shoot page
2018-05-23 12:04:32 -07:00
8fca537251 T-shoot page edits 2018-05-23 11:18:46 -07:00
cf39956e2d Tiny tweak to troubleshooting page 2018-05-23 09:10:47 -07:00
9e3a8ab4ed updated troubleshoot page 2018-05-23 07:50:38 -07:00
022a6765bf removing libs/automation, libs/chassis 2018-05-21 15:19:26 -07:00
1e4edc5109 Patch release (0.1.57) (#655)
Release 0.1.57 with tutorial fix patch
2018-05-18 14:26:13 -07:00
caf273be84 fix line following paragraph 2018-05-18 13:53:59 -07:00
ccba83cfab 0.1.57 2018-05-18 16:32:14 -04:00
8417c6ce57 Bumping pxt-core to 3.13.29 2018-05-18 16:31:36 -04:00
39236fe8b2 Release app 0.1.56 2018-05-18 10:51:16 -04:00
f50aabeec5 Update issue templates 2018-05-17 16:25:35 -07:00
c2167b6405 0.1.56 2018-05-16 06:37:29 -07:00
59dcd1ee72 fix another support link 2018-05-16 06:37:17 -07:00
bf8f73f885 Update favicon as per Lego spec (#650) 2018-05-15 13:40:55 -07:00
a81e3b9f11 Better description for stop all sounds. (#649) 2018-05-15 11:21:24 -07:00
e90b6a7946 0.1.55 2018-05-15 07:41:06 -07:00
7ce6c8b773 updated support with https link 2018-05-15 07:40:54 -07:00
022651b338 removing blurb 2018-05-15 07:38:18 -07:00
8d0bc280a0 Adding prepare card. (#594) 2018-05-14 11:49:06 -07:00
7b61a8fbc3 Releasing patch 0.1.54 (#628) 2018-05-11 18:04:53 -07:00
1d45652ab2 0.1.54 2018-05-11 15:58:11 -07:00
4db9c8bc0a Bump pxt-core to 3.13.28 2018-05-11 15:57:54 -07:00
df99fa1699 adding filename filter 2018-05-10 11:05:16 -07:00
ef218bcc24 0.1.53 2018-05-09 15:02:27 -04:00
58 changed files with 491 additions and 284 deletions

35
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
Add screenshots to help explain your problem. You can copy paste the screenshot in the github report. The .gif screen recording is very useful as well.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -24,7 +24,6 @@ In a common folder,
``` ```
npm install npm install
typings install
``` ```
* go to ``pxt-common-packages`` and run * go to ``pxt-common-packages`` and run

View File

@ -1,16 +1,15 @@
<footer class="ui inverted accent vertical footer segment hideprint" aria-hidden="false"> <footer class="ui vertical footer segment hideprint" aria-hidden="false">
<div class="ui center aligned container"> <div class="ui center aligned container">
<div class="ui container horizontal inverted small divided link list"> <div class="ui section divider"></div>
<div class="ui container horizontal small divided link list">
<!-- <a class="item" href="https://makecode.com/contact" target="_blank" rel="noopener">Contact Us</a> --> <!-- <a class="item" href="https://makecode.com/contact" target="_blank" rel="noopener">Contact Us</a> -->
<a class="item" href="https://makecode.com/privacy" target="_blank" rel="noopener">Privacy &amp; Cookies</a> <a class="item" href="https://makecode.com/privacy" target="_blank" rel="noopener">Privacy &amp; Cookies</a>
<a class="item" href="https://makecode.com/termsofuse" target="_blank" rel="noopener"> Terms Of Use</a> <a class="item" href="https://makecode.com/termsofuse" target="_blank" rel="noopener"> Terms Of Use</a>
<a class="item" href="https://makecode.com/trademarks" target="_blank" rel="noopener">Trademarks</a> <a class="item" href="https://makecode.com/trademarks" target="_blank" rel="noopener">Trademarks</a>
<div class="item">© 2018 Microsoft</div> <div class="item">© 2018 Microsoft</div>
<!-- we need to force the browser to load this font -->
<div style='font-family: Icons; color: #010101;' aria-hidden="true">.</div>
</div> </div>
<div class="ui container horizontal inverted small divided link list"> <div class="ui container horizontal small divided link list">
<a class="ui centered item" href="https://makecode.com/" title="Microsoft MakeCode" target="_blank" rel="noopener">Powered by Microsoft MakeCode</a> <a class="ui centered item" href="https://makecode.com/" title="Microsoft MakeCode" target="_blank" rel="noopener">Powered by Microsoft MakeCode</a>
</div> </div>
</div> </div>
</footer> </footer>

View File

@ -3,8 +3,8 @@
## Support #support ## Support #support
* [Troubleshoot](/troubleshoot) * [Troubleshoot](/troubleshoot)
* [LEGO Support](http://service.lego.com/)
* [EV3 Manager](https://ev3manager.education.lego.com/) * [EV3 Manager](https://ev3manager.education.lego.com/)
* [LEGO Support](https://www.lego.com/service/)
## Projects #projects ## Projects #projects

View File

@ -22,7 +22,7 @@ In nature, creatures use many methods to get around. None of them, however, use
### Build ### Build
Think about a creatures movement for inspiration. Will you make the robot walk, crawl, hop, or wiggle? Your mechanism can be attached or unattached to the EV3 brick. You can start by tinkering with the LEGO elements in the picture above and then build on. Think about a creatures movement for inspiration. Will you make the robot walk, crawl, hop, or wiggle? Your mechanism can be attached or unattached to the EV3 Brick. You can start by tinkering with the LEGO elements in the picture above and then build on.
### Building Hint ### Building Hint

View File

@ -32,7 +32,7 @@ Think about:
### Build ### Build
Think about a creatures movement for inspiration. Your mechanism can be attached or unattached to the EV3 brick. You can start by tinkering with the LEGO elements in the picture add then build on. Think about a creatures movement for inspiration. Your mechanism can be attached or unattached to the EV3 Brick. You can start by tinkering with the LEGO elements in the picture add then build on.
More building ideas: More building ideas:
@ -92,7 +92,7 @@ This program checks if the Ultrasonic Sensor senses something near.
The blocks inside the ``||loops:forever||`` loop have these actions: The blocks inside the ``||loops:forever||`` loop have these actions:
1. Turn on the ``green`` EV3 brick Status Light. 1. Turn on the ``green`` EV3 Brick Status Light.
2. Wait for Ultrasonic Sensor to detect an object. 2. Wait for Ultrasonic Sensor to detect an object.
3. Turn on Motors ``A`` and ``D`` in opposite directions. 3. Turn on Motors ``A`` and ``D`` in opposite directions.
4. Wait for one quarter of a second (``1500`` milli seconds). 4. Wait for one quarter of a second (``1500`` milli seconds).

View File

@ -4,6 +4,14 @@
```codecard ```codecard
[ [
{
"name": "Prepare",
"imageUrl": "/static/lessons/firmware.png",
"description": "To use Microsoft MakeCode with your EV3 Brick, you will need to install the latest LEGO® MINDSTORMS® Education EV3 firmware. Follow these steps to make sure you're up to date and install the latest firmware if you need to.",
"label": "New? Start Here!",
"labelClass": "red ribbon large",
"url": "https://makecode.mindstorms.com/troubleshoot"
},
{ {
"name": "Try", "name": "Try",
"imageUrl": "/static/lessons/try.png", "imageUrl": "/static/lessons/try.png",

View File

@ -0,0 +1,194 @@
# Try
## Introduction @unplugged
Get a quick introduction to programming with EV3.
![Display on EV3 Brick with Music Notes](/static/getting-started/01_EyesOn_Intro.png)
We are excited to help you get started with @boardname@. In this project we will guide you through connecting your EV3 Brick, creating your first program, controlling a Large Motor, a Touch Sensor and a Color Sensor. These steps can take up to 45 minutes.
## Turn on your EV3 Brick @unplugged
Power on your EV3 Brick by pressing the Center Button.
![Hand pressing power button](/static/getting-started/02_PowerOn.png)
## Connect Your EV3 Brick to Your Device @unplugged
Use the USB cable to connect your EV3 Brick to your device.
![Computer and cable connected to EV3 Brick](/static/getting-started/03_insert-usb-02.png)
## Handle a button press @fullscreen
Drag out a ``||brick:on button||`` block from Buttons section in the ``||brick:Brick||`` Toolbox drawer.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
})
```
## Change of mood @fullscreen
Drag a Brick Screen ``||brick:show mood||`` block inside the ``||brick:on button||`` block.
Change mood to ``neutral``.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
brick.showMood(moods.neutral)
})
```
## Simulate @fullscreen
**Try out your code in the simulator!**
Click the center button on the EV3 Brick in the web page. It should display the mood you selected on the screen. Don't hesitate to use the simulator to try out your code during this tutorial!
![EV3 Brick simulator](/static/getting-started/simulate.png)
## Play some tunes @fullscreen
Drag a Music ``||music:play sound effect||`` block below the ``||brick:show mood||`` block.
Change sound effect to ``communication hello``.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
brick.showMood(moods.neutral)
music.playSoundEffect(sounds.communicationHello)
})
```
## Download to your brick @unplugged
**Download:** Click **Download** and follow the instructions to get your code onto your EV3 Brick. Press the center button on the EV3 Brick to run the program.
### Did It Work?
Verify that the program you just created shows eyes on the Brick Display, and that the EV3 Brick played the sound “Hello!”
![EV3 Brick with eyes on the display](/static/getting-started/05_EyesOn.png)
**Well done!**
## Connect a Large Motor @unplugged
Now you will learn to control the Large Motor.
![EV3 Brick with hands connecting Large Motor to Port D](/static/getting-started/06_PlugInLargeMotor.png)
Connect a Large Motor to **Port D** of your EV3 Brick using any of the connector cables.
## Run a motor @fullscreen
Drag a ``||motors:run large A motor||`` block inside the ``||brick:on button||`` block.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
motors.largeA.run(50)
})
```
## Tune your motor @fullscreen
Change ``large motor A`` to ``large motor D``.
Click on the **(+)** sign and change to ``1`` rotation.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
motors.largeD.run(50, 1, MoveUnit.Rotations)
})
```
## Download @unplugged
**Download:** Click **Download** and follow the instructions to get your code onto your EV3 Brick. Press the center button on the EV3 Brick to run the program.
### Did It Rotate?
Confirm that your motor has turned one rotation at power level 50 before stopping.
Download and run the program as many times as you want in order to verify this, or tinker with different power levels and different rotations.
![Large Motor D w/Rotating “WHRRR,” Hand, EV3 Brick](/static/getting-started/08_WorkingLargeMotor.png)
## Connect a Touch Sensor @unplugged
We will now control the Large Motor using a Touch Sensor.
Keeping the Large Motor connected to **Port D**, connect a Touch Sensor to **Port 1** of your EV3 Brick.
![Hands connecting Touch Sensor to Port 1 on EV3 Brick](/static/getting-started/09_Connect_Touch.png)
## Modify Your Program @fullscreen
* Add a ``||sensors:pause until touch 1 pressed||`` Sensor block on top of the ``||motors:run large motor D||`` block.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
sensors.touch1.pauseUntil(ButtonEvent.Pressed)
motors.largeD.run(50, 1, MoveUnit.Rotations)
})
```
## Download @unplugged
**Download:** Click **Download** and follow the instructions to get your code onto your EV3 Brick. Press the center button on the EV3 Brick to run the program.
### Press the Touch Sensor
Confirm that the Large Motor has turned one rotation AFTER you press the Touch Sensor.
Download and run the program as many times as you want in order to verify this, or tinker with different Touch Sensor and Large Motor values.
![Hand Touch Sensor Pressed & EV3 Brick & Large Motor](/static/getting-started/11_TouchMotorWorking.png)
## Connect a Color Sensor @unplugged
Now we will try to control the Large Motor using another sensor.
![Hand connecting Color Sensor to Port 4, Large Motor D, EV3 Brick](/static/getting-started/12_ConnectColor.png)
Keeping the Large Motor connected to **Port D**, connect the Color Sensor to **Port 4**.
## Update your code @fullscreen
Using the same program, replace the ``||sensors:pause until touch 1||`` block with a ``||sensors:pause color sensor 3||`` for color block.
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
sensors.color3.pauseUntilColorDetected(ColorSensorColor.Green)
motors.largeD.run(50, 1, MoveUnit.Rotations)
})
```
Don't forget to select the color you want to detect (e.g., green)!
## Download @unplugged
**Download:** Click **Download** and follow the instructions to get your code onto your EV3 Brick. Press the center button on the EV3 Brick to run the program.
### Place a Colored Brick in Front of the Color Sensor
Confirm that the Large Motor has turned one rotation AFTER the Color Sensor has detected the colored brick.
Download and run the program as many times as you want in order to verify this, or tinker with different Color Sensor and Large Motor values.
![IMG: Colored bricks in front of Color Sensor, hands, EV3 Brick](/static/getting-started/14_ColorSensorWorking.png)
## JavaScript @fullscreen
Click on the **JavaScript** tab and change the color the Color Sensor detects to Black, Blue, Green, Yellow, Red, White, or Brown. Use Title Case for the color names.
```typescript
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
sensors.color3.pauseUntilColorDetected(ColorSensorColor.Blue)
motors.largeD.run(50, 1, MoveUnit.Rotations)
})
```
## Well Done! @unplugged
You have now learned how to control some of the inputs and outputs of the EV3.

View File

@ -1,10 +1,10 @@
# Try # Try
Get a quick introduction to programming with EV3. Get a quick introduction to programming with EV3.
![Display on EV3 Brick with Music Notes](/static/getting-started/01_EyesOn_Intro.png) ![Display on EV3 Brick with Music Notes](/static/getting-started/01_EyesOn_Intro.png)
We are excited to help you get started with @boardname@. In this project we will guide you through connecting your EV3 brick, creating your first program, controlling a Large Motor, a Touch Sensor and a Color Sensor. These steps can take up to 45 minutes. We are excited to help you get started with @boardname@. In this project we will guide you through connecting your EV3 Brick, creating your first program, controlling a Large Motor, a Touch Sensor and a Color Sensor. These steps can take up to 45 minutes.
## Turn on your EV3 Brick ## Turn on your EV3 Brick

View File

@ -1,3 +1,3 @@
{ {
"appref": "v0.1.50" "appref": "v0.2.3"
} }

View File

@ -37,7 +37,7 @@ Place a ``||motors:tank large B+C||`` block from ``||motors:Motors||`` under ``|
Change the speed to `-60%` (for motor B) and `+60%` (for motor C). Change the speed to `-60%` (for motor B) and `+60%` (for motor C).
Change the rotations to `9`. Change the rotations to `9`.
The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 brick. The motors are set for the reverse direction because they are mounted upside down in this model. The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 Brick. The motors are set for the reverse direction because they are mounted upside down in this model.
```blocks ```blocks
motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations) motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)
@ -47,7 +47,7 @@ motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)
Place a ``||motors:stop all motors||`` block under ``||motors:tank large B+C||``. Place a ``||motors:stop all motors||`` block under ``||motors:tank large B+C||``.
The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 brick then stop. The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 Brick then stop.
```blocks ```blocks
motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations) motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)
@ -59,7 +59,7 @@ motors.stopAll()
Place a ``||brick:show string||`` block under ``||motors:stop all motors||``. Place a ``||brick:show string||`` block under ``||motors:stop all motors||``.
Change the `"Hello World"` text to `"30 cm"`. Change the `"Hello World"` text to `"30 cm"`.
The ``||motors:tank large B+C||`` will run for `9` rotations when the **center** button is pressed on the EV3 brick then stop and display "30 cm" on the EV3 Bricks screen. The ``||motors:tank large B+C||`` will run for `9` rotations when the **center** button is pressed on the EV3 Brick then stop and display "30 cm" on the EV3 Bricks screen.
```blocks ```blocks
motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations) motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)

View File

@ -38,7 +38,7 @@ Place a ``||motors:tank large B+C||`` block from ``||motors:Motors||`` under ``|
Change the speed to `-60%` (for motor B) and `+60%` (for motor C). Change the speed to `-60%` (for motor B) and `+60%` (for motor C).
Change the rotations to `9`. Change the rotations to `9`.
The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 brick. The motors are set for the reverse direction because they are mounted upside down in this model. The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 Brick. The motors are set for the reverse direction because they are mounted upside down in this model.
```blocks ```blocks
motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations) motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)
@ -48,7 +48,7 @@ motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)
Place a ``||motors:stop all motors||`` block under ``||motors:tank large B+C||``. Place a ``||motors:stop all motors||`` block under ``||motors:tank large B+C||``.
The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 brick then stop. The ``||motors:tank large B+C||`` block will run for `9` rotations when the **center** button is pressed on the EV3 Brick then stop.
```blocks ```blocks
motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations) motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)
@ -60,7 +60,7 @@ motors.largeBC.stop()
Place a ``||brick:show string||`` block under ``||motors:stop all motors||``. Place a ``||brick:show string||`` block under ``||motors:stop all motors||``.
Change the `"Hello World"` text to `"30 cm"`. Change the `"Hello World"` text to `"30 cm"`.
The ``||motors:tank large B+C||`` will run for `9` rotations when the **center** button is pressed on the EV3 brick then stop and display "30 cm" on the EV3 Bricks screen. The ``||motors:tank large B+C||`` will run for `9` rotations when the **center** button is pressed on the EV3 Brick then stop and display "30 cm" on the EV3 Bricks screen.
```blocks ```blocks
motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations) motors.largeBC.tank(-60, 60, 9, MoveUnit.Rotations)

View File

@ -1,9 +1,5 @@
# Maker Activites # Maker Activites
These six activities require the [@boardname@ Core Set (45544)](https://education.lego.com/en-us/products/lego-mindstorms-education-ev3-core-set-/5003400). Supporting materials for teachers and middle school students are provided, offering everything teachers and students need to explore their inner makers as they follow the design process to solve open-ended, themed challenges...
* [Download Curriculum Materials](https://education.lego.com/en-us/downloads/mindstorms-ev3/curriculum)
## Activites ## Activites
```codecard ```codecard

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/static/getting-started/simulate.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -3,7 +3,7 @@
<msapplication> <msapplication>
<tile> <tile>
<square150x150logo src="/mstile-150x150.png"/> <square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor> <TileColor>#33adcb</TileColor>
</tile> </tile>
</msapplication> </msapplication>
</browserconfig> </browserconfig>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -2,14 +2,60 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="904.000000pt" height="904.000000pt" viewBox="0 0 904.000000 904.000000" width="326.000000pt" height="326.000000pt" viewBox="0 0 326.000000 326.000000"
preserveAspectRatio="xMidYMid meet"> preserveAspectRatio="xMidYMid meet">
<metadata> <metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013 Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata> </metadata>
<g transform="translate(0.000000,904.000000) scale(0.100000,-0.100000)" <g transform="translate(0.000000,326.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none"> fill="#000000" stroke="none">
<path d="M0 4520 l0 -4510 4520 0 4520 0 0 4510 0 4510 -4520 0 -4520 0 0 <path d="M1535 3046 c-5 -2 -35 -9 -65 -16 -30 -7 -69 -23 -85 -36 -38 -30
-4510z"/> -29 -49 37 -81 131 -64 395 -46 468 32 l22 23 -39 26 c-53 35 -134 53 -239 54
-49 1 -93 -1 -99 -2z"/>
<path d="M1122 2799 l-64 -30 56 -41 c74 -54 87 -92 93 -269 5 -129 4 -139
-20 -190 -97 -213 -600 -265 -788 -82 -38 37 -49 55 -58 101 -6 30 -11 75 -11
98 0 24 -4 45 -9 48 -8 5 -228 -88 -243 -102 -3 -4 78 -58 180 -121 295 -181
588 -360 987 -606 204 -125 375 -228 381 -228 6 0 154 87 330 193 175 107 330
200 344 208 14 7 165 98 335 202 171 103 365 221 432 262 67 40 119 76 115 79
-18 18 -236 109 -242 102 -4 -4 -10 -37 -13 -73 -10 -105 -22 -134 -79 -184
-29 -25 -57 -46 -64 -46 -7 0 -33 -9 -58 -20 -39 -16 -128 -31 -201 -34 -62
-2 -186 18 -248 41 -106 38 -171 87 -204 152 -24 48 -27 63 -24 145 6 224 14
253 93 316 l57 45 -71 33 c-39 17 -74 32 -78 32 -5 0 -8 -19 -7 -43 2 -78 -21
-134 -72 -177 -153 -132 -500 -137 -674 -9 -39 28 -50 44 -65 93 -11 33 -19
77 -18 98 2 47 -6 47 -92 7z m729 -454 c163 -53 253 -149 252 -270 -1 -268
-14 -325 -95 -396 -38 -33 -77 -55 -138 -78 -74 -26 -203 -49 -250 -44 -8 1
-46 5 -85 8 -105 10 -220 56 -288 117 -74 66 -87 106 -92 293 -4 128 -2 145
18 195 29 69 110 135 212 170 92 31 138 37 271 35 90 -2 127 -8 195 -30z"/>
<path d="M1619 2246 c-2 -2 -33 -7 -69 -10 -91 -10 -176 -43 -222 -87 -46 -43
-45 -64 3 -115 27 -28 112 -66 179 -79 36 -8 188 -8 230 -1 120 20 220 82 220
137 0 65 -118 130 -260 145 -36 3 -68 8 -71 10 -3 2 -8 2 -10 0z"/>
<path d="M1297 1873 c-3 -2 -1 -18 5 -35 68 -194 612 -185 653 11 7 31 5 33
-11 26 -193 -80 -377 -88 -561 -25 -45 16 -84 26 -86 23z"/>
<path d="M1350 2775 c0 -68 96 -119 240 -128 144 -9 288 34 309 94 13 39 -1
45 -59 24 -112 -40 -311 -38 -432 4 -47 16 -58 17 -58 6z"/>
<path d="M680 2674 c-99 -19 -210 -72 -223 -108 -10 -25 31 -64 91 -87 75 -28
256 -35 335 -13 107 32 177 77 177 115 0 22 -42 53 -101 74 -44 16 -229 28
-279 19z"/>
<path d="M2448 2675 c-2 -2 -30 -5 -63 -8 -99 -8 -184 -54 -185 -99 0 -26 74
-75 149 -99 96 -30 262 -31 352 0 66 21 90 39 102 73 16 46 -149 121 -285 131
-37 2 -69 3 -70 2z"/>
<path d="M1050 2380 c-34 -19 -149 -52 -200 -58 -121 -14 -268 -4 -332 23 -48
19 -48 19 -48 -9 0 -35 37 -71 101 -97 45 -18 74 -22 174 -22 101 -1 130 3
185 23 78 28 125 61 138 99 12 33 3 53 -18 41z"/>
<path d="M2184 2363 c2 -16 7 -36 11 -45 13 -32 112 -84 200 -104 11 -3 65 -5
120 -6 154 -1 253 41 271 116 6 26 5 28 -12 22 -87 -34 -252 -48 -364 -32 -51
8 -161 42 -202 63 -27 13 -28 13 -24 -14z"/>
<path d="M11 2146 c4 -31 10 -88 14 -128 4 -40 9 -80 10 -89 2 -9 6 -40 10
-70 6 -55 32 -266 40 -329 5 -36 11 -93 20 -177 3 -27 8 -65 11 -85 5 -35 28
-53 716 -553 391 -284 712 -514 715 -512 2 3 6 237 7 521 2 369 0 520 -8 530
-9 11 -465 295 -576 358 -19 11 -47 29 -62 39 -14 11 -31 19 -37 19 -6 0 -11
4 -11 8 0 5 -12 14 -27 21 -14 7 -49 27 -77 45 -52 34 -467 288 -515 316 -14
8 -68 41 -120 73 -126 79 -119 78 -110 13z"/>
<path d="M2816 1930 c-236 -143 -431 -260 -433 -260 -3 0 -17 -8 -31 -19 -15
-10 -166 -103 -337 -206 -170 -103 -313 -191 -316 -196 -7 -13 -12 -1049 -4
-1049 4 0 382 267 500 354 11 8 135 96 275 196 140 100 262 186 270 193 8 7
94 68 190 136 96 68 180 128 187 135 10 9 28 108 38 214 2 18 6 45 9 60 3 15
8 52 11 82 4 30 11 87 16 125 5 39 12 88 15 110 2 22 7 56 9 76 3 20 8 56 10
80 3 24 7 60 10 79 10 67 17 150 14 150 -2 0 -197 -117 -433 -260z"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -1,6 +1,6 @@
{ {
"name": "", "name": "MakeCode for EV3",
"short_name": "", "short_name": "MakeCode for EV3",
"icons": [ "icons": [
{ {
"src": "/android-chrome-192x192.png", "src": "/android-chrome-192x192.png",
@ -8,12 +8,14 @@
"type": "image/png" "type": "image/png"
}, },
{ {
"src": "/android-chrome-512x512.png", "src": "/android-chrome-256x256.png",
"sizes": "512x512", "sizes": "256x256",
"type": "image/png" "type": "image/png"
} }
], ],
"theme_color": "#ffffff", "theme_color": "#ff0000",
"background_color": "#ffffff", "background_color": "#ff0000",
"display": "standalone" "start_url": "makecode.mindstorms.com",
"display": "standalone",
"orientation": "portrait"
} }

BIN
docs/static/lessons/firmware.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -1,33 +1,39 @@
# Troubleshooting download problems # Troubleshooting download problems
If your're having trouble getting your code onto the EV3 Brick, try these steps to see if you can fix the problem. If you're having trouble getting your code onto the EV3 Brick, try these steps to see if you can fix the problem.
## Check your **@drivename@** firmware ## Check your **@drivename@** firmware
MakeCode requires the firmware version **1.10E** or up. MakeCode needs a firmware version of **1.10E** or higher installed on your brick.
### ~hint ### ~hint
Firmware is the software that runs all the basic operations on your brick. Your programs run with the firmware to make the @boardname@ do all the things you want it to do. Your brick comes with the firmware already installed. You could have a brick with an older version of firmware that needs updating in order for it to work properly with MakeCode. Firmware is the software that runs all the basic operations on your EV3 Brick. Your programs and the firmware work together to make the EV3 Brick do all things you want it to. Your EV3 Brick comes with firmware pre-installed, but it may need to be updated to work properly with MakeCode.
### ~ ### ~
To check the version on your brick, To check the the firmware version on your EV3 Brick:
* go to the **Settings** menu (wrench symbol) 1. Go to the **Settings** menu (it's under the wrench tool symbol)
* select to **Brick Info** 2. Select **Brick Info** and press ENTER
![Brick Info menu](/static/setup/brickinfo.jpg) ![Brick Info menu](/static/setup/brickinfo.jpg)
* check the version under **Brick FW:** 3. Check the version number under **Brick FW:**
![Brick Firmware version](/static/setup/brickfw.jpg) ![Brick Firmware version](/static/setup/brickfw.jpg)
If you cannot find the **brick info** or the version is less than **1.10E**, **you need to upgrade your firmware**. If you can't find the **Brick Info** or you see that the version is less than **1.10E**, **you need to upgrade your firmware**.
**To update your firmware, use the [EV3 manager](https://ev3manager.education.lego.com/)** or follow these instructions: [Updating and Resetting Firmware](https://www.lego.com/en-us/service/help/products/themes-sets/mindstorms/updating-and-resetting-lego-mindstorms-ev3-firmware-408100000007884). ## Upgrade your **@drivename@**
If your EV3 Brick isn't connected to the internet through a computer, or with some other mobile device, you'll need to do a manual update of the firmware. Read the instructions in the **Manual Firmware Update** section of the [Firmware Update](https://education.lego.com/en-us/support/mindstorms-ev3/firmware-update) support page. If your a firmware version level is less than **1.10E**, you need to install an upgraded version. You can upgrade the firmware with the **EV3 Lab** or **EV3 Programming** software. Also, you can do a manual upgrade by downloading the firmware install file. See the [Firmware Update](https://education.lego.com/en-us/support/mindstorms-ev3/firmware-update) support page to learn about the upgrade process.
### ~ hint
**Recommended:** Upgrade with the **[EV3 Device Manager](https://ev3manager.education.lego.com/)**
### ~
## Can I see the **@drivename@** drive on my computer? ## Can I see the **@drivename@** drive on my computer?
@ -39,27 +45,27 @@ On Windows, it looks like this in Explorer:
If you don't see the **@drivename@** drive, make sure your brick is powered on and check that your USB connection is good. If you don't see the **@drivename@** drive, make sure your brick is powered on and check that your USB connection is good.
## Is my brick charged and powered on? ## The display on the EV3 Brick is blank
Make sure your brick is charged and powered on. If your brick doesn't turn on, find the charger and plug it into wall power, then connect it to your brick. Does it turn on and start up? Make sure your EV3 Brick is charged and powered on. If your it doesn't turn on, find the charger and plug it into wall power, then connect it to your EV3 Brick. Does it turn on and start up?
## Is my USB connection good? ## I still can't see my @drivename@ drive
Make sure that one end of your USB cable is firmly inserted into the port on the computer and the other end is connected to the brick. If you still can't see the **@drivename@** drive, try a different port on the computer. If that doesn't work then maybe your cable is bad or you need to reset the brick. Make sure that one end of your USB cable is firmly inserted into a USB port on the computer and the other end is connected to the EV3 Brick. If you still can't see the **@drivename@** drive, try a different port on the computer. If that doesn't work then maybe your cable is faulty or you need to reset the EV3 Brick.
## How do I reset my brick? ## How do I reset my EV3 Brick?
If you think your USB connection is good and you still can't see your **@drivename@** drive, try giving the brick a reset. You can follow these steps to reset: If you think your USB connection is good and you still can't see your **@drivename@** drive, try giving the EV3 Brick a reset. You can follow these steps to reset:
1. Using a finger from one hand, press the **Back** button. Keep holding it. 1. Using a finger from one hand, press the **Back** button. Keep holding it.
2. With your other hand, use two fingers to hold down both the **Left** button and the **Enter** button. You hold these at the same time while you're still pressing the **Back** button. 2. With your other hand, use two fingers to hold down both the **Left** button and the **Center** button. You hold these at the same time while you're still pressing the **Back** button.
3. Now, release your finger from the **Back** button. 3. Now, release your finger from the **Back** button.
4. When the brick says "Starting.." you can let go of the **Left** and **Enter** buttons. 4. When the EV3 Brick says "Starting.." you can let go of the **Left** and **Enter** buttons.
You can also watch this [How to Reset](https://www.lego.com/en-us/videos/themes/mindstorms/how-to-reset-the-ev3-p-brick-fbcbdbed398e4e12a7ce30fa662c54be) video to see how to do a reset. You can also watch this [How to Reset](https://www.lego.com/en-us/videos/themes/mindstorms/how-to-reset-the-ev3-p-brick-fbcbdbed398e4e12a7ce30fa662c54be) video.
## LEGO Support ## LEGO Support
If you've checked everything here and can't get the **@drivename@** drive to show up on your computer, you can't make the brick reset, or your program just won't download, then try the [Troubleshooting Walkthrough](https://www.lego.com/en-us/service/help/products/themes-sets/mindstorms/lego-mindstorms-ev3-troubleshooting-walkthrough-408100000009798). If you've checked everything here and can't get the **@drivename@** drive to show up on your computer, you can't make the EV3 Brick reset, or your program just won't download, then try the [Troubleshooting Walkthrough](https://www.lego.com/en-us/service/help/products/themes-sets/mindstorms/lego-mindstorms-ev3-troubleshooting-walkthrough-408100000009798).
You can also find more help at [LEGO Support](https://www.lego.com/en-us/mindstorms/support). You can also find more help at [LEGO Support](https://www.lego.com/en-us/mindstorms/support).

View File

@ -12,14 +12,14 @@ Step by step guides to coding your @boardname@.
"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 on your brick screen.", "description": "Create a custom animation on your EV3 Brick Display.",
"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"
}, { }, {
"name": "What Animal Am I?", "name": "What Animal Am I?",
"description": "Create different animal sounds and have someone guess the what the animal is.", "description": "Create different animal effects and have someone guess what the animal is.",
"cardType": "tutorial", "cardType": "tutorial",
"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"
@ -37,7 +37,7 @@ Step by step guides to coding your @boardname@.
```codecard ```codecard
[{ [{
"name": "Run Motors", "name": "Run Motors",
"description": "Use the buttons to start and stop the large and medium motors.", "description": "Use the EV3 Brick buttons to start and stop the Large Motor and Medium Motor.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/run-motors", "url":"/tutorials/run-motors",
"imageUrl":"/static/tutorials/run-motors.png" "imageUrl":"/static/tutorials/run-motors.png"
@ -49,13 +49,13 @@ Step by step guides to coding your @boardname@.
```codecard ```codecard
[{ [{
"name": "Touch to Run", "name": "Touch to Run",
"description": "Press the Touch sensor and run a motor.", "description": "Press the Touch Sensor and run a motor.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/touch-to-run", "url":"/tutorials/touch-to-run",
"imageUrl":"/static/tutorials/touch-to-run.png" "imageUrl":"/static/tutorials/touch-to-run.png"
}, { }, {
"name": "Touch Sensor Values", "name": "Touch Sensor Values",
"description": "Check the value of a Touch sensor and stop a motor if pressed.", "description": "Check the value of a Touch Sensor and stop a motor if pressed.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/touch-sensor-values", "url":"/tutorials/touch-sensor-values",
"imageUrl":"/static/tutorials/touch-sensor-values.png" "imageUrl":"/static/tutorials/touch-sensor-values.png"
@ -67,19 +67,19 @@ Step by step guides to coding your @boardname@.
```codecard ```codecard
[{ [{
"name": "What Color?", "name": "What Color?",
"description": "Use the Color sensor to detect different colors.", "description": "Use the Color Sensor to detect different colors.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/what-color", "url":"/tutorials/what-color",
"imageUrl":"/static/tutorials/what-color.png" "imageUrl":"/static/tutorials/what-color.png"
}, { }, {
"name": "Line Following", "name": "Line Following",
"description": "Use the Color sensor to make a robot follow a line.", "description": "Use the Color Sensor to make a robot follow a line.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/line-following", "url":"/tutorials/line-following",
"imageUrl":"/static/tutorials/line-following.png" "imageUrl":"/static/tutorials/line-following.png"
}, { }, {
"name": "Red Light, Green Light", "name": "Red Light, Green Light",
"description": "Play Red Light, Green Light using the Color sensor and the robot.", "description": "Play Red Light, Green Light using the Color Sensor and the robot.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/redlight-greenlight", "url":"/tutorials/redlight-greenlight",
"imageUrl":"/static/tutorials/redlight-greenlight.png" "imageUrl":"/static/tutorials/redlight-greenlight.png"
@ -103,7 +103,7 @@ Step by step guides to coding your @boardname@.
```codecard ```codecard
[{ [{
"name": "Security Alert", "name": "Security Alert",
"description": "Build an security alert using the infrared sensor.", "description": "Build an security alert using the Infrared Sensor.",
"cardType": "tutorial", "cardType": "tutorial",
"url":"/tutorials/security-alert", "url":"/tutorials/security-alert",
"imageUrl":"/static/tutorials/security-alert.png" "imageUrl":"/static/tutorials/security-alert.png"

View File

@ -2,7 +2,7 @@
## Introduction @unplugged ## Introduction @unplugged
Make a program to follow a line using the Color sensor and reflected light. Let's test reflected light to see if it's white or black (on the line), and drive our robot accordingly. Make your @boardname@ robot follow a line using the Color Sensor's Reflected Light Intensity Mode.
![Brick with color sensors tracking a yellow line](/static/tutorials/line-following/line-following.gif) ![Brick with color sensors tracking a yellow line](/static/tutorials/line-following/line-following.gif)
@ -36,7 +36,7 @@ forever(function () {
## Step 3 ## Step 3
Open the ``||sensors:Sensors||`` Toolbox drawer. From the **Color Sensor** section, drag out a ``||sensors:color sensor light||`` value block and drop it into the second slot of the ``||logic:0 < 0||`` comparison block, replacing the `0`. Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out a ``||sensors:color sensor light||`` value block and drop it into the second slot of the ``||logic:0 < 0||`` comparison block, replacing the second `0`.
```blocks ```blocks
forever(function () { forever(function () {
@ -50,7 +50,7 @@ forever(function () {
## Step 4 ## Step 4
If the value of the reflected light is greater than 40% (white or very light), our robot is outside the line, so steer to the left. In the ``||logic:0 < 0||`` comparison block change the compared value to `40` replacing `0`. If the value of the reflected light is greater than 40% (white or very light), our robot is outside the line, so steer to the left. In the ``||logic:0 < 0||`` comparison block change the first compared value from `0` to `40`.
```blocks ```blocks
forever(function () { forever(function () {
@ -64,7 +64,7 @@ forever(function () {
## Step 5 ## Step 5
Open the ``||motors:Motors||`` Toolbox drawer. Drag out **2** ``||motors:tank large motors||`` blocks and drop one of them into the ``||logic:if||`` part, and the other into the ``||logic:else||`` part of the ``||logic:if then else||`` block. Open the ``||motors:Motors||`` Toolbox drawer. Drag out **2** ``||motors:tank motors||`` blocks and drop one of them into the ``||logic:if||`` part, and the other into the ``||logic:else||`` part of the ``||logic:if then else||`` block.
```blocks ```blocks
forever(function () { forever(function () {
@ -78,7 +78,7 @@ forever(function () {
## Step 6 ## Step 6
In the first ``||motors:tank large motors||`` block in the ``||logic:if||`` clause, change the speed values of the motors from ``50%``, ``50%`` to ``5%``, ``15%``. This slows down the robot, and steers it to the left (because the **C** motor is driving faster than the **B** motor). In the first ``||motors:tank motors||`` block in the ``||logic:if||`` clause, change the speed values of the motors from ``50%``, ``50%`` to ``5%``, ``15%``. This slows down the robot and steers it to the left (because the **C** motor is driving faster than the **B** motor).
```blocks ```blocks
forever(function () { forever(function () {
@ -90,9 +90,9 @@ forever(function () {
}) })
``` ```
# Step 7 ## Step 7
In the second ``||motors:tank large motors||`` block in the ``||logic:else||`` clause, change the speed values of the motors from ``50%``, ``50%`` to ``15%``, ``5%``. This slows down the robot, and steers it to the right (because the **B** motor is driving faster than the **C** motor). In the second ``||motors:tank motors||`` block in the ``||logic:else||`` clause, change the speed values of the motors from ``50%``, ``50%`` to ``15%``, ``5%``. This slows down the robot and steers it to the right (because the **B** motor is driving faster than the **C** motor).
```blocks ```blocks
forever(function () { forever(function () {
@ -110,11 +110,10 @@ Use the EV3 simulator to try out your code.
![Brick with color sensors tracking a yellow line](/static/tutorials/line-following/line-following.gif) ![Brick with color sensors tracking a yellow line](/static/tutorials/line-following/line-following.gif)
Move the slider under the Color Sensor to change the reflected light and check that motors Move the slider under the Color Sensor to change the reflected light intensity and check that motors are moving as you would expect.
are moving as you would expect!
## Step 9 ## Step 9
Plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.
Attach a Color Sensor to Port 3 of your brick, and attach your brick to a driving base with large motors attached to Ports B and C. See the instructions for building a _Driving Base with Color Sensor Down_. Test your program by positioning your robot to the right of a dark, thick line and then let it drive! Attach a Color Sensor to Port 3 of your EV3 Brick, and attach your brick to a driving base with large motors attached to Ports B and C. See the instructions for building a _Driving Base with Color Sensor Down_. Test your program by positioning your robot to the right of a dark, thick line and then let it drive!

View File

@ -2,9 +2,9 @@
## Introduction @unplugged ## Introduction @unplugged
Create a custom animation for your @boardname@. Create a custom animation for your EV3 Brick
![Button press on brick](/static/tutorials/make-an-animation/button-pressed.gif) ![Button press on EV3 Brick](/static/tutorials/make-an-animation/button-pressed.gif)
## Step 1 ## Step 1
@ -46,7 +46,7 @@ brick.showString("Press my button!", 1)
## Step 5 ## Step 5
Try out your code in the EV3 simulator! Try out your code in the EV3 Brick simulator!
Press the ``Enter`` button and check that the image shows up as you expected. Press the ``Enter`` button and check that the image shows up as you expected.
@ -64,4 +64,4 @@ brick.showString("Press my button!", 1)
## Step 7 ## Step 7
Plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.

View File

@ -25,7 +25,7 @@ brick.showString("Press my buttons to make music!", 1)
## Step 3 ## Step 3
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 anywhere onto the Workspace.
```blocks ```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
@ -68,7 +68,7 @@ brick.showString("Press my buttons to make music!", 1)
## Step 6 ## Step 6
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 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! 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!

View File

@ -134,6 +134,6 @@ forever(function () {
## Step 10 ## Step 10
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.
Attach an Ultrasonic Sensor to Port 4 of your brick. Test your program by putting an object at different distances in front of the Ultrasonic Sensor an object 50 centimeters or closer should be detected. Attach an Ultrasonic Sensor to Port 4 of your EV3 Brick. Test your program by putting an object at different distances in front of the Ultrasonic Sensor an object 50 centimeters or closer should be detected.

View File

@ -2,13 +2,13 @@
## Introduction @unplugged ## Introduction @unplugged
Use the ``||sensors:pause color sensor||`` block to play Red Light, Green Light with your @boardname@ robot! Use the ``||sensors:pause until color sensor detected||`` block to play Red Light, Green Light with your @boardname@ robot!
![Brick simulation with color sensor and motors](/static/tutorials/redlight-greenlight/redlight-greenlight.gif) ![Brick simulation with color sensor and motors](/static/tutorials/redlight-greenlight/redlight-greenlight.gif)
## Step 1 ## Step 1
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out **2** ``||sensors:pause color sensor||`` blocks onto the Workspace, and drop them into the ``||loops:forever||`` loop. Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out **2** ``||sensors:pause until color sensor detected||`` blocks onto the Workspace, and drop them into the ``||loops:forever||`` loop.
```blocks ```blocks
forever(function () { forever(function () {
@ -19,7 +19,7 @@ forever(function () {
## Step 2 ## Step 2
In the first ``||sensors:pause color sensor||`` block, use the second drop-down menu to select the "Green" color. In the second ``||sensors:pause color sensor||`` block, use the second drop-down menu to select the "Red" color. In the first ``||sensors:pause until color sensor detected||`` block, use the second drop-down menu to select the Green color. In the second ``||sensors:pause until color sensor detected||`` block, use the second drop-down menu to select the Red color.
![Color selection dropdown](/static/tutorials/redlight-greenlight/pause-color-sensor-dropdown.png) ![Color selection dropdown](/static/tutorials/redlight-greenlight/pause-color-sensor-dropdown.png)
@ -32,7 +32,7 @@ forever(function () {
## Step 3 ## Step 3
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:tank large motors||`` block onto the Workspace, and drop in between the ``||sensors:pause color sensor||`` blocks. Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:tank motors||`` block onto the Workspace, and drop in between the ``||sensors:pause until color sensor detected||`` blocks.
```blocks ```blocks
forever(function () { forever(function () {
@ -44,7 +44,7 @@ forever(function () {
## Step 4 ## Step 4
Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop all motors||`` block onto the Workspace, and drop it in after the second ``||sensors:pause color sensor||`` block in the ``||loops:forever||`` loop. Open the ``||motors:Motors||`` Toolbox drawer. Drag out a ``||motors:stop all motors||`` block onto the Workspace, and drop it in after the second ``||sensors:pause until color sensor detected||`` block in the ``||loops:forever||`` loop.
```blocks ```blocks
forever(function () { forever(function () {
@ -57,6 +57,6 @@ forever(function () {
## Step 5 ## Step 5
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.
Attach a Color Sensor to Port 3 of your brick, and attach your brick to a driving base with large motors attached to Ports B and C. See the building instructions for: _Driving Base with Color Sensor Forward_. Test your program by putting a green or red piece of paper or LEGO brick in front of the color sensor. Attach a Color Sensor to Port 3 and attach your EV3 Brick to a driving base with Large Motors attached to Ports B and C. See the building instructions for: _Driving Base with Color Sensor Forward_. Test your program by putting a green or red piece of paper or LEGO brick in front of the Color Sensor.

View File

@ -2,13 +2,13 @@
## Introduction @unplugged ## Introduction @unplugged
Use the buttons to start and stop the large and medium motors. Use the buttons to start and stop the Large Motor and Medium Motor.
![Motors in simulator running](/static/tutorials/run-motors/run-motors.gif) ![Motors in simulator running](/static/tutorials/run-motors/run-motors.gif)
## Step 1 ## Step 1
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 anywhere onto the Workspace.
```blocks ```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
@ -49,9 +49,9 @@ brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
## Step 4 ## Step 4
The ``||motors:run||`` blocks specify which type of motor to run (Large or Medium), and which port the motor is attached to (Ports A, B, C, or D). The default setting is to run the large motor attached to port A at 50% speed. The ``||motors:run||`` blocks specify which type of motor to run (Large Motor or Medium Motor), and which port the motor is attached to (Ports A, B, C, or D). The default setting is to run the Large Motor attached to Port A at 50% speed.
When we press the Down button, we want our motor to run in the reverse direction. In the ``||motors:run||`` block that is in the ``||brick:on button down pressed||`` block, change the speed value from ``50%`` to ``-50%``. When we press the ``down`` button, we want our motor to run in the reverse direction. In the ``||motors:run||`` block that is in the ``||brick:on button down pressed||`` block, change the speed value from ``50%`` to ``-50%``.
![Motor speed select field](/static/tutorials/run-motors/run-speed-field.png) ![Motor speed select field](/static/tutorials/run-motors/run-speed-field.png)
@ -104,7 +104,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
## Step 7 ## Step 7
For the ``||motors:run||`` blocks that are in the ``||brick:on button left||`` and ``||brick:on button right||`` blocks, use the drop-down menu to select a ``medium motor`` on port ``D``. For the ``||motors:run||`` blocks that are in the ``||brick:on button left||`` and ``||brick:on button right||`` blocks, use the drop-down menu to select a ``medium motor`` on Port ``D``.
| | | | | | | |
|-|-|-| |-|-|-|
@ -146,7 +146,7 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
## Step 9 ## Step 9
Lets 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%``. Lets also change the speed that our Medium Motor is 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%``.
```blocks ```blocks
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () { brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
@ -206,7 +206,7 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
## Step 12 ## Step 12
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 it into the ``||brick:on button enter||`` block.
```blocks ```blocks
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () { brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
@ -228,6 +228,6 @@ brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
## Step 13 ## Step 13
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 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. 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.

View File

@ -2,13 +2,13 @@
## Introduction @unplugged ## Introduction @unplugged
The Infrared Sensor uses infrared light waves to detect proximity to the robot. Build an security alert using the infrared sensor. The Infrared Sensor uses infrared light waves to detect proximity to the robot. Build an security alert using the Infrared Sensor.
![Brick in simulator with infrared sensor](/static/tutorials/security-alert/security-alert.gif) ![Brick in simulator with infrared sensor](/static/tutorials/security-alert/security-alert.gif)
## Step 1 ## Step 1
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out an ``||sensors:on infrared||`` block onto the Workspace (you can place this anywhere). Use the second drop-down menu to select ``detected``. Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out an ``||sensors:on infrared object||`` block onto the Workspace (you can place this anywhere). Select ``detected`` from the second dropdown menu.
![Sensor detect method dropdown selections](/static/tutorials/security-alert/detect-method-dropdown.png) ![Sensor detect method dropdown selections](/static/tutorials/security-alert/detect-method-dropdown.png)
@ -20,7 +20,7 @@ sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
## Step 2 ## Step 2
Open the ``||brick:Brick||`` Toolbox drawer. From the **Screen** section, drag out a ``||brick:show image||`` block onto the Workspace, and drop it into the ``||sensors:on infrared||`` block. Open the ``||brick:Brick||`` Toolbox drawer. From the **Screen** section, drag out a ``||brick:show image||`` block onto the Workspace, and drop it into the ``||sensors:on infrared object||`` block.
```blocks ```blocks
sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () { sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
@ -42,7 +42,7 @@ sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
## Step 4 ## Step 4
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out a ``||brick:set status light||`` block onto the Workspace, and drop it after the ``||brick:show image||`` block. Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out a ``||brick:set status light to||`` block onto the Workspace, and drop it after the ``||brick:show image||`` block.
```blocks ```blocks
sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () { sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
@ -53,7 +53,7 @@ sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
## Step 5 ## Step 5
In the ``||brick:set status light||`` block, use the drop-down menu to select the ``red flash`` light In the ``||brick:set status light to||`` block, use the drop-down menu to select the ``red flash`` light
![Status light selection dropdown list](/static/tutorials/security-alert/set-status-light-dropdown.png) ![Status light selection dropdown list](/static/tutorials/security-alert/set-status-light-dropdown.png)
@ -66,7 +66,7 @@ sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
## Step 6 ## Step 6
Open the ``||loops:Loops||`` Toolbox drawer. Drag a ``||loops:repeat||`` loop onto the Workspace, and drop it after the ``||brick:set status light||`` block. Open the ``||loops:Loops||`` Toolbox drawer. Drag a ``||loops:repeat||`` loop onto the Workspace, and drop it after the ``||brick:set status light to||`` block.
```blocks ```blocks
sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () { sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
@ -100,6 +100,6 @@ In the ``||music:play sound effect until done||`` block, use the drop-down menu
## Step 9 ## Step 9
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.
Attach an Infrared Sensor to Port 1 of your brick. Test your program by putting an object increasingly closer to the Infrared Sensor your Intruder Alert should trigger when you get too close! Attach an Infrared Sensor to Port 1 of your Ev3 Brick. Test your program by putting an object increasingly closer to the Infrared Sensor your Intruder Alert should trigger when you get too close!

View File

@ -2,13 +2,13 @@
## Introduction @unplugged ## Introduction @unplugged
Use the Touch sensor value to stop a running motor. Use the Touch Sensor value to stop a running motor.
![Touch sensor and motor attached to brick](/static/tutorials/touch-sensor-values/touch-to-stop.gif) ![Touch sensor and motor attached to brick](/static/tutorials/touch-sensor-values/touch-to-stop.gif)
## Step 1 ## Step 1
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.
```blocks ```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {

View File

@ -2,13 +2,13 @@
## Introduction @unplugged ## Introduction @unplugged
Use the Touch sensor to run a motor. Use the Touch Sensor to run a motor.
![Large motor connected to brick](/static/tutorials/touch-to-run/touch-to-run.gif) ![Large motor connected to brick](/static/tutorials/touch-to-run/touch-to-run.gif)
## Step 1 ## Step 1
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 anywhere onto the Workspace.
```blocks ```blocks
sensors.touch1.onEvent(ButtonEvent.Pressed, function () { sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
@ -62,6 +62,6 @@ sensors.touch1.onEvent(ButtonEvent.Released, function () {
## Step 5 ## Step 5
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 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? Attach a Large Motor to Port A, and a Touch Sensor to Port 1 on your EV3 Brick. Test your program by pressing and releasing the touch sensor does the motor start and stop as expected?

View File

@ -6,7 +6,7 @@ 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)
## Step 1 ## Step 1 @fullscreen
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.
@ -16,7 +16,7 @@ brick.showMood(moods.sleeping)
## Step 2 ## Step 2
Notice your brick is snoring with eyes closed in the simulator! Lets wake her up. Open the ``||brick:Brick||`` Toolbox drawer again. Drag out **2** more ``||brick:show mood||`` blocks and drop them into the ``||brick:on start||`` block also. Notice your EV3 Brick is snoring with eyes closed in the simulator! Lets wake it up. Open the ``||brick:Brick||`` Toolbox drawer again. Drag out **2** more ``||brick:show mood||`` blocks and drop them into the ``||brick:on start||`` block also.
```blocks ```blocks
brick.showMood(moods.sleeping) brick.showMood(moods.sleeping)

View File

@ -16,21 +16,21 @@ brick.showString("Hello world", 1)
## Step 2 ## Step 2
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 teh animal"`` to replace ``"Hello world"``.
```blocks ```blocks
brick.showString("Guess what animal?", 1) brick.showString("Guess the animal", 1)
``` ```
## Step 3 ## Step 3
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 anywhere onto the Workspace.
```blocks ```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () { brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
}) })
brick.showString("Guess what animal?", 1) brick.showString("Guess the animal", 1)
``` ```
## Step 4 ## Step 4
@ -43,7 +43,7 @@ In the ``||brick:on button||`` block, use the drop-down menu to select the ``lef
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () { brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
}) })
brick.showString("Guess what animal?", 1) brick.showString("Guess the animal", 1)
``` ```
## Step 5 ## Step 5
@ -63,7 +63,7 @@ brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
brick.buttonDown.onEvent(ButtonEvent.Pressed, function () { brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
}) })
brick.showString("Guess what animal?", 1) brick.showString("Guess the animal", 1)
``` ```
## Step 6 ## Step 6
@ -83,7 +83,7 @@ brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
brick.buttonDown.onEvent(ButtonEvent.Pressed, function () { brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
brick.showImage(images.expressionsBigSmile) brick.showImage(images.expressionsBigSmile)
}) })
brick.showString("Guess what animal?", 0) brick.showString("Guess the animal", 0)
``` ```
## Step 7 ## Step 7
@ -105,7 +105,7 @@ brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
brick.buttonDown.onEvent(ButtonEvent.Pressed, function () { brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
brick.showImage(images.objectsPirate) brick.showImage(images.objectsPirate)
}) })
brick.showString("Guess what animal?", 0) brick.showString("Guess the animal", 0)
``` ```
## Step 8 ## Step 8
@ -129,7 +129,7 @@ brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
brick.showImage(images.objectsPirate) brick.showImage(images.objectsPirate)
music.playSoundEffect(sounds.animalsCatPurr) music.playSoundEffect(sounds.animalsCatPurr)
}) })
brick.showString("Guess what animal?", 0) brick.showString("Guess the animal", 0)
``` ```
## Step 9 ## Step 9
@ -155,7 +155,7 @@ brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
brick.showImage(images.objectsPirate) brick.showImage(images.objectsPirate)
music.playSoundEffect(sounds.animalsSnakeHiss) music.playSoundEffect(sounds.animalsSnakeHiss)
}) })
brick.showString("Guess what animal?", 0) brick.showString("Guess the animal", 0)
``` ```
## Step 10 ## Step 10

View File

@ -2,7 +2,7 @@
## Introduction @unplugged ## Introduction @unplugged
Use the Color sensor to detect different colors. Use the Color Sensor to detect different colors.
![Simulator view with color sensor](/static/tutorials/what-color/color-detector.gif) ![Simulator view with color sensor](/static/tutorials/what-color/color-detector.gif)
@ -24,7 +24,7 @@ brick.showString("What color?", 1)
## Step 3 ## Step 3
Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out **3** ``||sensors:on color sensor detected||`` blocks onto the Workspace (you can place these anywhere). Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out **3** ``||sensors:on color sensor detected||`` blocks anywhere onto the Workspace.
```blocks ```blocks
sensors.color3.onColorDetected(ColorSensorColor.Blue, function () { sensors.color3.onColorDetected(ColorSensorColor.Blue, function () {
@ -57,7 +57,7 @@ brick.showString("What color?", 1)
## Step 5 ## Step 5
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out a **3** ``||brick:set status light||`` blocks and drop one of them each into the ``||sensors:on color detected||`` blocks. Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out **3** ``||brick:set status light||`` blocks and drop one of them each into the ``||sensors:on color sensor detected||`` blocks.
```blocks ```blocks
sensors.color3.onColorDetected(ColorSensorColor.Red, function () { sensors.color3.onColorDetected(ColorSensorColor.Red, function () {
@ -91,7 +91,7 @@ brick.showString("What color?", 1)
## Step 7 ## Step 7
Open the ``||music:Music||`` Toolbox drawer. Drag out **3** ``||music:play sound effect||`` blocks and drop one of them each into the ``||sensors:on color detected||`` blocks after the ``||brick:set status light||`` block. Open the ``||music:Music||`` Toolbox drawer. Drag out **3** ``||music:play sound effect||`` blocks and drop one of them each into the ``||sensors:on color sensor detected||`` blocks after the ``||brick:set status light||`` block.
```blocks ```blocks
sensors.color3.onColorDetected(ColorSensorColor.Red, function () { sensors.color3.onColorDetected(ColorSensorColor.Red, function () {
@ -131,6 +131,6 @@ brick.showString("What color?", 1)
## Step 9 ## Step 9
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the brick. Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.
Attach a Color Sensor to Port 3 of your brick. Test your program by flashing Red, Green and Yellow colored paper or use LEGO bricks in front of the Color Sensor. Attach a Color Sensor to Port 3 of your EV3 Brick. Test your program by flashing Red, Green and Yellow colored paper or use LEGO bricks in front of the Color Sensor.

View File

@ -98,11 +98,13 @@ export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
resp.outfiles[pxtc.BINARY_UF2] = btoa(data) resp.outfiles[pxtc.BINARY_UF2] = btoa(data)
let saveUF2Async = () => { let saveUF2Async = () => {
if (isCli || !pxt.commands.saveOnlyAsync) { if (pxt.commands && pxt.commands.electronDeployAsync) {
return Promise.resolve() return pxt.commands.electronDeployAsync(resp);
} else {
return pxt.commands.saveOnlyAsync(resp)
} }
if (!isCli && pxt.commands && pxt.commands.saveOnlyAsync) {
return pxt.commands.saveOnlyAsync(resp);
}
return Promise.resolve();
} }
if (noHID) return saveUF2Async() if (noHID) return saveUF2Async()

View File

@ -49,7 +49,7 @@ pxt.editor.initExtensionsAsync = function (opts: pxt.editor.ExtensionOptions): P
<span class="ui yellow circular label">1</span> <span class="ui yellow circular label">1</span>
<strong>${lf("Connect the EV3 to your computer with a USB cable")}</strong> <strong>${lf("Connect the EV3 to your computer with a USB cable")}</strong>
<br /> <br />
<span style="font-size:small">${lf("Use the miniUSB port on the top of the EV3 brick")}</span> <span style="font-size:small">${lf("Use the miniUSB port on the top of the EV3 Brick")}</span>
</div> </div>
</div> </div>
</div> </div>
@ -62,7 +62,7 @@ pxt.editor.initExtensionsAsync = function (opts: pxt.editor.ExtensionOptions): P
<div class="content"> <div class="content">
<div class="description"> <div class="description">
<span class="ui yellow circular label">2</span> <span class="ui yellow circular label">2</span>
<strong>${lf("Move the .uf2 file to the EV3 brick")}</strong> <strong>${lf("Move the .uf2 file to the EV3 Brick")}</strong>
<br /> <br />
<span style="font-size:small">${lf("Locate the downloaded .uf2 file and drag it to the EV3 USB drive")}</span> <span style="font-size:small">${lf("Locate the downloaded .uf2 file and drag it to the EV3 USB drive")}</span>
</div> </div>

View File

@ -240,7 +240,7 @@ export class FieldMusic extends pxtblockly.FieldImages implements Blockly.FieldC
this.stopSounds(); this.stopSounds();
} }
private createTextNode_(content: string) { protected createTextNode_(content: string) {
const category = this.parseCategory(content); const category = this.parseCategory(content);
let text = content.substr(content.indexOf(' ') + 1); let text = content.substr(content.indexOf(' ') + 1);
text = text.length > 15 ? text.substr(0, 12) + "..." : text; text = text.length > 15 ? text.substr(0, 12) + "..." : text;

View File

@ -1,6 +0,0 @@
{
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/automation",
"dependencies": {
"ev3": "file:../ev3"
}
}

View File

@ -1,3 +0,0 @@
# Chassis
A library to control a chassis.

View File

@ -1,97 +0,0 @@
/**
* A differential drive robot
*/
//% weight=50 color=#cf00cf
namespace chassis {
/**
* A differential drive robot
*/
//% fixedInstances
export class Chassis {
// the motor pair
public motors: motors.SynchedMotorPair;
// the radius of the wheel (cm)
public wheelRadius: number;
// the distance between the wheels (cm)
public baseLength: number;
constructor() {
this.motors = motors.largeBC;
this.wheelRadius = 3;
this.baseLength = 12;
}
/**
* Makes a differential drive robot move with a given speed (cm/s) and rotation rate (deg/s)
* using a unicycle model.
* @param speed speed of the center point between motors, eg: 10
* @param rotationSpeed rotation of the robot around the center point, eg: 30
* @param distance
**/
//% blockId=motorDrive block="drive %chassis|at %speed|cm/s|turning %rotationSpeed|deg/s"
//% inlineInputMode=inline
//% weight=95 blockGap=8
drive(speed: number, rotationSpeed: number, distance: number = 0) {
if (!speed) {
this.motors.stop();
return;
}
// speed is expressed in %
const R = this.wheelRadius; // cm
const L = this.baseLength; // cm
const PI = 3.14;
const maxw = 170 / 60 * 2 * PI; // rad / s
const maxv = maxw * R; // cm / s
// speed is cm / s
const v = speed; // cm / s
const w = rotationSpeed / 360 * 2 * PI; // rad / s
const vr = (2 * v + w * L) / (2 * R); // rad / s
const vl = (2 * v - w * L) / (2 * R); // rad / s
const sr = vr / maxw * 100; // %
const sl = vl / maxw * 100; // %
// cm / (cm/s) = s
const seconds = distance / speed;
this.motors.tank(sr, sl, seconds, MoveUnit.Seconds)
}
/**
* Sets the wheel radius in centimeters
* @param cm
*/
//% blockId=chassisSetWheelRadius block="set %chassis|wheel radius to %cm|(cm)"
setWheelRadius(cm: number) {
this.wheelRadius = cm;
}
/**
* Sets the base length in centimeters
* @param cm
*/
//% blockId=chassisSetBaseLength block="set %chassis|base length to %cm|(cm)"
setBaseLength(cm: number) {
this.baseLength = cm;
}
/**
* Sets the motors used by the chassis, default is B+C
* @param motors
*/
//% blockId=chassisSetMotors block="set %chassis|motors to %motors"
//% weight=10
setMotors(motors: motors.SynchedMotorPair) {
this.motors = motors;
}
toString(): string {
return `chassis base ${this.baseLength}, wheel ${this.wheelRadius}`;
}
}
//% fixedInstance whenUsed
export const chassis = new Chassis();
}

View File

@ -1,15 +0,0 @@
{
"name": "chassis",
"description": "Chassis robot support",
"files": [
"README.md",
"chassis.ts"
],
"testFiles": [
"test.ts"
],
"public": true,
"dependencies": {
"core": "file:../core"
}
}

View File

@ -1 +0,0 @@

View File

@ -132,6 +132,7 @@ namespace motors {
protected _port: Output; protected _port: Output;
protected _portName: string; protected _portName: string;
protected _brake: boolean; protected _brake: boolean;
private _pauseOnRun: boolean;
private _initialized: boolean; private _initialized: boolean;
private _init: () => void; private _init: () => void;
private _run: (speed: number) => void; private _run: (speed: number) => void;
@ -142,6 +143,7 @@ namespace motors {
this._port = port; this._port = port;
this._portName = outputToName(this._port); this._portName = outputToName(this._port);
this._brake = false; this._brake = false;
this._pauseOnRun = true;
this._initialized = false; this._initialized = false;
this._init = init; this._init = init;
this._run = run; this._run = run;
@ -172,6 +174,19 @@ namespace motors {
this._brake = brake; this._brake = brake;
} }
/**
* Indicates to pause while a motor moves for a given distance or duration.
* @param value true to pause; false to continue the program execution
*/
//% blockId=outputMotorSetPauseMode block="set %motor|pause on run %brake=toggleOnOff"
//% motor.fieldEditor="motors"
//% weight=60 blockGap=8
//% group="Properties"
setPauseOnRun(value: boolean) {
this.init();
this._pauseOnRun = value;
}
/** /**
* Inverts the motor polarity * Inverts the motor polarity
*/ */
@ -201,13 +216,22 @@ namespace motors {
this.settle(); this.settle();
} }
private settle() { protected settle() {
// if we've recently completed a motor command with brake // if we've recently completed a motor command with brake
// allow 500ms for robot to settle // allow 500ms for robot to settle
if(this._brake) if (this._brake)
pause(500); pause(500);
} }
protected pauseOnRun(stepsOrTime: number) {
if (stepsOrTime && this._pauseOnRun) {
// wait till motor is done with this work
this.pauseUntilReady();
// allow robot to settle
this.settle();
}
}
/** /**
* Resets the motor(s). * Resets the motor(s).
*/ */
@ -269,10 +293,7 @@ namespace motors {
} }
this._move(useSteps, stepsOrTime, speed); this._move(useSteps, stepsOrTime, speed);
// wait till motor is done with this work this.pauseOnRun(stepsOrTime);
this.pauseUntilReady();
// allow robot to settle
this.settle();
} }
/** /**
@ -306,12 +327,12 @@ namespace motors {
(Data8) NO Port number [0 - 3] (Data8) NO Port number [0 - 3]
(Data8) TYPE Output device type, (0x07: Large motor, Medium motor = 0x08) Dispatch status Unchanged (Data8) TYPE Output device type, (0x07: Large motor, Medium motor = 0x08) Dispatch status Unchanged
Description This function enables specifying the output device type Description This function enables specifying the output device type
*/ */
for (let i = 0; i < DAL.NUM_OUTPUTS; ++i) { for (let i = 0; i < DAL.NUM_OUTPUTS; ++i) {
if (this._port & (1 << i)) { if (this._port & (1 << i)) {
const b = mkCmd(i, DAL.opOutputSetType, 1) const b = mkCmd(i, DAL.opOutputSetType, 1)
b.setNumber(NumberFormat.Int8LE, 2, large ? 0x07 : 0x08) b.setNumber(NumberFormat.Int8LE, 2, large ? 0x07 : 0x08)
writePWM(b) writePWM(b)
} }
} }
} }
@ -333,7 +354,7 @@ namespace motors {
motors.__motorUsed(this._port, this._large); motors.__motorUsed(this._port, this._large);
} }
private __init() { private __init() {
this.setOutputType(this._large); this.setOutputType(this._large);
} }
@ -572,6 +593,8 @@ namespace motors {
stepsOrTime: stepsOrTime, stepsOrTime: stepsOrTime,
useBrake: this._brake useBrake: this._brake
}); });
this.pauseOnRun(stepsOrTime);
} }
/** /**

View File

@ -164,7 +164,7 @@ void playTone(int frequency, int ms) {
} }
/** /**
* Play a tone through the speaker for some amount of time. * Stop all sounds.
*/ */
//% help=music/stop-all-sounds //% help=music/stop-all-sounds
//% blockId=music_stop_all_sounds block="stop all sounds" //% blockId=music_stop_all_sounds block="stop all sounds"

View File

@ -5,7 +5,8 @@ namespace music {
*/ */
//% weight=1 help=music/note-frequency //% weight=1 help=music/note-frequency
//% blockId=device_note block="%note" //% blockId=device_note block="%note"
//% shim=TD_ID color="#FFFFFF" colorSecondary="#FFFFFF" //% shim=TD_ID
//% color="#FFFFFF" colorSecondary="#FFFFFF" colorTertiary="#D67923"
//% note.fieldEditor="note" note.defl="1046" //% note.fieldEditor="note" note.defl="1046"
//% note.fieldOptions.editorColour="#FF1493" note.fieldOptions.decompileLiterals=true //% note.fieldOptions.editorColour="#FF1493" note.fieldOptions.decompileLiterals=true
//% note.fieldOptions.minNote=52 note.fieldOptions.maxNote=75 //% note.fieldOptions.minNote=52 note.fieldOptions.maxNote=75
@ -15,4 +16,4 @@ namespace music {
//TODO fill in actual min/max note values //TODO fill in actual min/max note values
return name; return name;
} }
} }

View File

@ -26,7 +26,7 @@ declare namespace music {
function playTone(frequency: int32, ms: int32): void; function playTone(frequency: int32, ms: int32): void;
/** /**
* Play a tone through the speaker for some amount of time. * Stop all sounds.
*/ */
//% help=music/stop-all-sounds //% help=music/stop-all-sounds
//% blockId=music_stop_all_sounds block="stop all sounds" //% blockId=music_stop_all_sounds block="stop all sounds"

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "pxt-ev3", "name": "pxt-ev3",
"version": "0.1.52", "version": "0.3.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "pxt-ev3", "name": "pxt-ev3",
"version": "0.1.52", "version": "0.3.2",
"description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode", "description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode",
"private": true, "private": true,
"keywords": [ "keywords": [
@ -39,8 +39,8 @@
"webfonts-generator": "^0.4.0" "webfonts-generator": "^0.4.0"
}, },
"dependencies": { "dependencies": {
"pxt-common-packages": "0.22.7", "pxt-common-packages": "0.23.15",
"pxt-core": "3.12.26" "pxt-core": "3.19.4"
}, },
"scripts": { "scripts": {
"test": "node node_modules/pxt-core/built/pxt.js travis" "test": "node node_modules/pxt-core/built/pxt.js travis"

View File

@ -42,7 +42,7 @@
"useUF2": true, "useUF2": true,
"useELF": true, "useELF": true,
"hasHex": true, "hasHex": true,
"deployDrives": ".*", "deployDrives": "EV3",
"deployFileMarker": "INFO_UF2.TXT", "deployFileMarker": "INFO_UF2.TXT",
"driveName": "EV3", "driveName": "EV3",
"flashCodeAlign": 256, "flashCodeAlign": 256,
@ -98,6 +98,7 @@
"betaUrl": "https://makecode.legoeducation.com/about", "betaUrl": "https://makecode.legoeducation.com/about",
"driveDisplayName": "EV3", "driveDisplayName": "EV3",
"boardName": "LEGO® MINDSTORMS® Education EV3", "boardName": "LEGO® MINDSTORMS® Education EV3",
"copyrightText": "LEGO, the LEGO logo, MINDSTORMS and the MINDSTORMS EV3 logo are trademarks and/ or copyrights of the LEGO Group. ©2018 The LEGO Group. All rights reserved.",
"crowdinProject": "kindscript", "crowdinProject": "kindscript",
"selectLanguage": true, "selectLanguage": true,
"availableLocales": [ "availableLocales": [
@ -107,11 +108,11 @@
"docMenu": [ "docMenu": [
{ {
"name": "Support", "name": "Support",
"path": "http://service.lego.com" "path": "https://www.lego.com/service/"
}, },
{ {
"name": "Troubleshoot", "name": "Troubleshoot",
"path": "/troubleshoot" "path": "https://makecode.mindstorms.com/troubleshoot"
}, },
{ {
"name": "Blocks", "name": "Blocks",
@ -170,7 +171,8 @@
}, },
"monacoColors": { "monacoColors": {
"editor.background": "#f9f9f9" "editor.background": "#f9f9f9"
} },
"fileNameExclusiveFilter": "[^a-zA-Z]"
}, },
"ignoreDocsErrors": true "ignoreDocsErrors": true
} }

View File

@ -15,6 +15,6 @@
"Maker": "maker" "Maker": "maker"
}, },
"electronManifest": { "electronManifest": {
"latest": "v0.1.43" "latest": "v0.1.60"
} }
} }