Compare commits
101 Commits
Author | SHA1 | Date | |
---|---|---|---|
de8d5302f8 | |||
3399306b87 | |||
469767a40a | |||
604fa764e6 | |||
25cf2a9cdb | |||
7549f865d6 | |||
a5de9d88bb | |||
0437df10de | |||
2079173dfa | |||
018a1e7528 | |||
757f95d984 | |||
8bc3fdc8ba | |||
e8a1e73cf5 | |||
e9b2b239ad | |||
5ad2288a9f | |||
92d13ef343 | |||
471ca5d915 | |||
f745079728 | |||
d179f18ef3 | |||
805fc6c787 | |||
374bbb8304 | |||
25452efc92 | |||
80b9c715b2 | |||
cb816c91ad | |||
3012068986 | |||
4c9c7d6a69 | |||
ad3652c290 | |||
d8971829e3 | |||
8ca4558fc2 | |||
d85b5c5129 | |||
95b1c6a50f | |||
4dc2872286 | |||
6c9ff804c8 | |||
7581b5af9e | |||
07504027f9 | |||
a0e133864a | |||
0285711954 | |||
91be998d7e | |||
e862869327 | |||
8047cb2612 | |||
8e2ffefd2c | |||
092e7b0522 | |||
42454ecd57 | |||
2563fd6031 | |||
e0c1f2dca0 | |||
c80574ed3f | |||
b28b5cb6b7 | |||
d1f11059db | |||
6de5c6afdf | |||
b72c7c0c4f | |||
352c1ca5ec | |||
6d940a9ec7 | |||
c070173346 | |||
6fcf68f174 | |||
02f2a85d28 | |||
f63196908e | |||
ad48ee12ca | |||
83aeb24a98 | |||
fc5ecd9f10 | |||
0b3b840ac1 | |||
60c09809e7 | |||
148067a143 | |||
6f34887c94 | |||
64a9930c2e | |||
5815e16647 | |||
c4f5e425c2 | |||
361ae7a2d2 | |||
3769402ade | |||
5c3c83eb52 | |||
0f07a89981 | |||
11d887a213 | |||
8150b2dbb0 | |||
89f41f23da | |||
6b78e08053 | |||
186c86d2b1 | |||
181c71d2dd | |||
be05da3232 | |||
5958157a76 | |||
f72b825377 | |||
d76af5e5af | |||
23f48db20b | |||
2975bf2b55 | |||
5314515619 | |||
75b2db9f67 | |||
cf2e39f1b2 | |||
6d15d69aa1 | |||
72a0940235 | |||
b08dd8a7d2 | |||
def648a98b | |||
32a92789b3 | |||
9956bb06fb | |||
83b9aecd7a | |||
17ab24eaa9 | |||
9c5d5f9a86 | |||
43a13e0877 | |||
fe0915484d | |||
87a65aa38f | |||
1317da8904 | |||
62b2881e2a | |||
bf482a2ac9 | |||
243600ad8f |
12
.github/workflows/calibreapp-image-actions.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
name: Compress images
|
||||
on: pull_request
|
||||
jobs:
|
||||
build:
|
||||
name: calibreapp/image-actions
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: calibreapp/image-actions
|
||||
uses: docker://calibreapp/github-image-actions
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -4,6 +4,8 @@
|
||||
|
||||
* [Troubleshoot](/troubleshoot)
|
||||
* [EV3 Manager](https://ev3manager.education.lego.com/)
|
||||
* [Bluetooth](/bluetooth)
|
||||
* [Forum](https://forum.makecode.com)
|
||||
* [LEGO Support](https://www.lego.com/service/)
|
||||
* [FIRST LEGO League](/fll)
|
||||
|
||||
|
@ -28,7 +28,7 @@ program to a **.uf2** file, which you then copy to the **@drivename@** drive. Th
|
||||
|
||||
### ~ hint
|
||||
|
||||
Not seeing the **@drivename@** drive? Make sure to upgrade your firmware at https://ev3manager.education.lego.com/. Try these [troubleshooting](/troubleshoot) tips if you still have trouble getting the drive to appear.
|
||||
**Experimental support** for Bluetooth download is now available. Please read the [Bluetooth](/bluetooth) page for more information.
|
||||
|
||||
### ~
|
||||
|
||||
|
62
docs/bluetooth.md
Normal file
@ -0,0 +1,62 @@
|
||||
# Bluetooth
|
||||
|
||||
This page describes the procedure to download MakeCode program to the EV3 brick
|
||||
over Bluetooth.
|
||||
|
||||
## ~ hint
|
||||
|
||||
### WARNING: EXPERIMENTAL FEATURES AHEAD!
|
||||
|
||||
Support for Bluetooth download relies on [Web Serial](https://wicg.github.io/serial/),
|
||||
an experimental browser feature. Web Serial is a work [in progress](https://www.chromestatus.com/feature/6577673212002304);
|
||||
it may change or be removed in future versions without notice.
|
||||
|
||||
By enabling these experimental browser features, you could lose browser data or compromise your device security
|
||||
or privacy.
|
||||
|
||||
## ~
|
||||
|
||||
https://youtu.be/VIq8-6Egtqs
|
||||
|
||||
## Supported browsers
|
||||
|
||||
* Chrome desktop, version 77 and higher, Windows 10 or Mac OS.
|
||||
* [Edge Insider desktop](https://www.microsoftedgeinsider.com), version 77 and higher, Windows 10 or Mac OS.
|
||||
|
||||
To make sure your browser is up to date, go to the '...' menu, click "Help" then "About".
|
||||
|
||||
Next you need to enable the experimental features (this may change in the future)
|
||||
|
||||
* go to **chrome://flags/#enable-experimental-web-platform-features** and **enable**
|
||||
**Experimental Web Platform features**
|
||||
|
||||

|
||||
|
||||
## Machine Setup
|
||||
|
||||
* pair your EV3 brick with your computer over Bluetooth. This is the usual pairing procedure.
|
||||
|
||||
## Download over Bluetooth
|
||||
|
||||
* go to https://makecode.mindstorms.com/
|
||||
* click on **Download** to start a file download as usual
|
||||
* on the download dialog, you should see a **Bluetooth** button. Click on the
|
||||
**Bluetooth** button to enable the mode.
|
||||
* **make sure the EV3 brick is not running a program**
|
||||
* click on **Download** again to download over bluetooth.
|
||||
|
||||
## Choosing the correct serial port
|
||||
|
||||
Unfortunately, the browser dialog does not make it easy to select which serial port is the brick.
|
||||
|
||||
* On Windows, choose ``Standard Serial over Bluetooth``. There might be multiple of those but only one works. Try your luck! Once you know the COM port number, remember it for the next time around.
|
||||
* On Mac OS, choose ``cu.BRICKNAME-SerialPort``
|
||||
|
||||
## Known issues
|
||||
|
||||
* We do not detect properly that the program is running on the brick. Make sure to stop the program before starting the download procedure.
|
||||
* The list of programs on the brick screen is not updated when uploading via bluetooth.
|
||||
|
||||
## Feedback
|
||||
|
||||
Please send us your feedback through https://forum.makecode.com.
|
@ -212,6 +212,12 @@ Here are some fun programs for your @boardname@!
|
||||
"description": "Keep your brick entertained and happy",
|
||||
"url":"/examples/happy-unhappy",
|
||||
"cardType": "example"
|
||||
}, {
|
||||
{
|
||||
"name": "Turtle",
|
||||
"description": "Encode moves and run them on a driving base",
|
||||
"url":"/examples/turtle",
|
||||
"cardType": "example"
|
||||
}, {
|
||||
"name": "Distance Measurer",
|
||||
"description": "Use a motor to measure angle and distance",
|
||||
|
BIN
docs/file-manager.pdf
Normal file
44
docs/fll.md
@ -2,7 +2,9 @@
|
||||
|
||||

|
||||
|
||||
**For teams participating in the Open Software Platform Pilot utilizing MakeCode**, we’ve compiled a list of resources and information that we hope will be helpful for you.
|
||||
**For teams participating in City Shaper challenge**, you can use MakeCode for your challenge (see [City Shaper Challenge, page 7 bottom](https://firstinspiresst01.blob.core.windows.net/fll/2020/city-shaper-game-guide-pdf.pdf)!
|
||||
|
||||
We’ve compiled a list of resources and information that we hope will be helpful for you.
|
||||
|
||||
* **Got a question? Post it on the forums** at https://forum.makecode.com/
|
||||
|
||||
@ -17,23 +19,26 @@ If you found a bug, please try if it hasn't been fixed yet! Go to https://makeco
|
||||
* You will need to install the latest EV3 firmware on your brick. Instructions on how to do that are located here: https://makecode.mindstorms.com/troubleshoot.
|
||||
* You will need a computer with a USB port to connect to the EV3 in order to download your programs.
|
||||
* You will need internet access and a browser on your computer to get to https://makecode.mindstorms.com.
|
||||
* You can [install the app](/offline-app) to use the editor offline.
|
||||
|
||||
### I know LabView, how is MakeCode different?
|
||||
|
||||
We have compiled a guide for EV3 LabView users at https://makecode.mindstorms.com/labview.
|
||||
|
||||
### What’s the best way to get started with MakeCode?
|
||||
|
||||
Watch some of the videos at https://makecode.mindstorms.com (at the bottom of the page).
|
||||
Try some of the provided tutorials:
|
||||
Go to https://makecode.mindstorms.com. The home screen is filled with videos, tutorials and examples that might be relevant for your missions.
|
||||
|
||||
* [Wake Up!](@homeurl@#tutorial:tutorials/wake-up) – show your EV3 brick waking up
|
||||
* [Animation](@homeurl@#tutorial:tutorials/make-an-animation) – create a custom animation to show
|
||||
* [Music Brick](@homeurl@#tutorial:tutorials/music-brick) – transform your EV3 into a musical instrument
|
||||
* [Run Motors](@homeurl@#tutorial:tutorials/run-motors) – control the motors of your robot
|
||||
* [Red Light, Green Light](@homeurl@#tutorial:tutorials/redlight-greenlight) – play red light, green light with the color sensor
|
||||
* [Line Following](@homeurl@#tutorial:tutorials/line-following) – have your robot follow a line
|
||||
On the home page, scroll down to the **FLL / City Shaper** section for specific lessons related to Mission 2.
|
||||
|
||||
### Can I load both LEGO MINDSTORMS EV3 Software and MakeCode programs onto my EV3?
|
||||
|
||||
Yes.
|
||||
|
||||
### Does it work without internet?
|
||||
|
||||
No, the editor is cached in your browser cache. However, you can also download the [offline app](/offline-app) in case you need to install it on a computer.
|
||||
|
||||
### How do I figure out what a block does?
|
||||
|
||||
You can right-click on any block and select “Help” in the context menu to open the documentation page describing what that block does.
|
||||
@ -87,20 +92,19 @@ You can share your projects by clicking on the **share** button in the top left
|
||||
|
||||
Sharing programs is also shown in the [Tips and Tricks](https://legoeducation.videomarketingplatform.co/v.ihtml/player.html?token=5c594c2373367f7870196f519f3bfc7a&source=embed&photo%5fid=35719472) video.
|
||||
|
||||
### Can I use Bluetooth to transfer my program?
|
||||
|
||||
The official answer is currently no. That being said, we have **Experimental support** for Bluetooth download. Please read the [Bluetooth](/bluetooth) page for more information.
|
||||
|
||||
https://youtu.be/VIq8-6Egtqs
|
||||
|
||||
### Why can't I delete my program (*.uf2) files from the Brick?
|
||||
|
||||
There's a bug in the firmware which prevents you from deleting the programs (``*.uf2`` files) from your EV3 Brick. There isn't a firmware update to fix this yet. As a workaround, you can temporarily downgrade your firmware version, delete the files, and then upgrade back to the version that works with MakeCode.
|
||||
There's a bug in the firmware which prevents you from deleting the programs (``*.uf2`` files) from your EV3 Brick. There isn't a firmware update to fix this yet.
|
||||
|
||||
Follow these steps to downgrade your firmware version, delete the files, and uprgade back again:
|
||||
|
||||
1. Go into **EV3 LabVIEW** - if it's not installed get it [here](https://education.lego.com/en-us/downloads/mindstorms-ev3/software)
|
||||
2. Plug in your EV3 Brick and start a new project
|
||||
3. Go to the **Tools** menu in the upper right corner, select **Firmware Update**
|
||||
4. In the **Firmware Update** dialog box, click on the **Show Details** button
|
||||
5. From the **Available Firmware Files** list, select **EV3 Firmware V1.09E**
|
||||
6. Click the **Update Firmware** button and wait for the update to complete
|
||||
|
||||
Now the firmware version on the EV3 Brick will be **V1.09E**. Also, in the process, the downgrade deleted all of the saved programs from the EV3 Brick. To continue to use MakeCode, the firmware version must be at **V1.10E** or above. So, the Brick firmware needs to be upgraded again. If you don't know or do remember how to do this, see the **Upgrade your @drivename@** section in the [troubleshooting](/troubleshoot) page.
|
||||
We have prepared a special program that lets you delete UF2 files from the brick.
|
||||
Download [these PDF instructions](/file-manager.pdf) and drop the PDF on the brick drive.
|
||||
This will present you with an menu for deleting files.
|
||||
|
||||
For other common questions, try the FAQ page https://makecode.mindstorms.com/faq.
|
||||
|
||||
|
@ -54,6 +54,12 @@ Verify that the program you just created shows eyes on the Brick Display, and th
|
||||
|
||||
**Well done!**
|
||||
|
||||
## Run it Again
|
||||
|
||||

|
||||
|
||||
Use the Brick Buttons and navigate to the File Manager tab. Open the **BrkProg_SAVE** folder, select **Try** and click the center button to run it again.
|
||||
|
||||
## Connect a Large Motor
|
||||
|
||||
Now you will learn to control the Large Motor.
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"appref": "v1.0.11"
|
||||
"appref": "v1.2.22"
|
||||
}
|
||||
|
@ -61,6 +61,12 @@ motors.largeBC.steer(0, 50, 1, MoveUnit.Rotations);
|
||||
motors.largeBC.stop();
|
||||
```
|
||||
|
||||
### ~ hint
|
||||
|
||||
The **turn ratio range is -200, 200** unlike LabView who used -100,100.
|
||||
|
||||
### ~
|
||||
|
||||
## Tank
|
||||
|
||||
The **tank** blocks control the speed of two motors. These are commonly used for a differential drive robot. The blocks can also specify the duration, angle, or number of rotations.
|
||||
|
@ -388,12 +388,12 @@
|
||||
}
|
||||
function downloadWin64() {
|
||||
// TODO: Keep this link up-to-date with the desired release version
|
||||
window.open("https://makecode.com/api/release/ev3/v1.0.11/win64");
|
||||
window.open("https://makecode.com/api/release/ev3/v1.2.22/win64");
|
||||
tickEvent("offlineapp.download", { "target": "ev3", "platform": "win64" });
|
||||
}
|
||||
function downloadMac64() {
|
||||
// TODO: Keep this link up-to-date with the desired release version
|
||||
window.open("https://makecode.com/api/release/ev3/v1.0.11/mac64");
|
||||
window.open("https://makecode.com/api/release/ev3/v1.2.22/mac64");
|
||||
tickEvent("offlineapp.download", { "target": "ev3", "platform": "mac64" });
|
||||
}
|
||||
</script>
|
||||
|
@ -3,9 +3,3 @@
|
||||
## Offline app #target-app
|
||||
|
||||
The MakeCode editor is available as app which you can install on a computer with Windows or Mac OS. Once installed, the **[MakeCode Offline App](/offline-app)** lets you create, run, and download your projects to the @boardname@. It works the same as the Web application does in your browser but it's a stand-alone application that will work when a connection to the internet is restricted or not available.
|
||||
|
||||
### ~ hint
|
||||
|
||||
The [MakeCode Offline App](/offline-app) is currently in development and is made available as a **pre-release** version.
|
||||
|
||||
### ~
|
||||
|
47
docs/reference/brick/battery-property.md
Normal file
@ -0,0 +1,47 @@
|
||||
# battery Property
|
||||
|
||||
Return the information about the battery
|
||||
|
||||
```sig
|
||||
brick.batteryInfo(BatteryProperty.Level)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
* property: the kind of information
|
||||
|
||||
## Returns
|
||||
|
||||
* a [number](/types/number) which represents the value of the property requested.
|
||||
|
||||
## Example
|
||||
|
||||
Show the battery level percentage on the screen. Also, show a green light if the battery level is above 15%. If the battery level is below 15% but above 5%, show a orange light. But, if the battery level is below 5%, show a pulsing red light.
|
||||
|
||||
```blocks
|
||||
let battery = 0;
|
||||
forever(function() {
|
||||
brick.showString("Battery level:", 1)
|
||||
brick.showNumber(battery, 2)
|
||||
battery = brick.batteryInfo(BatteryProperty.Level);
|
||||
if (battery > 15)
|
||||
{
|
||||
brick.setStatusLight(StatusLight.Green);
|
||||
} else if (battery > 5) {
|
||||
brick.setStatusLight(StatusLight.Orange);
|
||||
} else {
|
||||
brick.setStatusLight(StatusLight.RedPulse)
|
||||
}
|
||||
pause(30000)
|
||||
})
|
||||
```
|
||||
|
||||
Or see all the values
|
||||
|
||||
```blocks
|
||||
forever(function () {
|
||||
brick.showValue("bat V", brick.batteryInfo(BatteryProperty.Voltage), 1)
|
||||
brick.showValue("bat %", brick.batteryInfo(BatteryProperty.Level), 2)
|
||||
brick.showValue("bat I", brick.batteryInfo(BatteryProperty.Current), 3)
|
||||
})
|
||||
```
|
@ -10,12 +10,12 @@ You can find out what's connected to the ports on the brick and show its status.
|
||||
|
||||
## Example
|
||||
|
||||
Show the status of the ports on the brick when the ``enter`` button is pressed.
|
||||
Show the status of the ports on the brick. Resets all motors when ENTER is pressed.
|
||||
|
||||
```blocks
|
||||
brick.showString("Press ENTER for port status", 1)
|
||||
brick.showPorts()
|
||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||
brick.showPorts()
|
||||
motors.resetAll()
|
||||
})
|
||||
```
|
||||
|
||||
|
59
docs/reference/motors/motor/ramp.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Ramp
|
||||
|
||||
Schedules an acceleration, constant and deceleration phase at a given speed.
|
||||
|
||||
```sig
|
||||
motors.largeA.ramp(50, 100, 500, 100)
|
||||
```
|
||||
|
||||
The speed setting is a percentage of the motor's full speed. Full speed is the speed that the motor runs when the brick supplies maximum output voltage to the port.
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
* **speed**: a [number](/types/number) that is the percentage of full speed. A negative value runs the motor in the reverse direction.
|
||||
* **acceleration**: the [number](/types/number) of movement units to rotate for while accelerating.
|
||||
* **value**: the [number](/types/number) of movement units to rotate for.
|
||||
* **deceleration**: the [number](/types/number) of movement units to rotate for while decelerating.
|
||||
* **unit**: the movement unit of rotation. This can be `milliseconds`, `seconds`, `degrees`, or `rotations`. If the number for **value** is `0`, this parameter isn't used.
|
||||
|
||||
## Example
|
||||
|
||||
This is an interactive program that lets you change the values of
|
||||
the acceleration and deceleration and see the effects.
|
||||
|
||||
```blocks
|
||||
let steady = 0
|
||||
let dec = 0
|
||||
let acc = 0
|
||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||
acc += -100
|
||||
})
|
||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||
motors.largeB.ramp(50, steady, MoveUnit.MilliSeconds, acc, dec)
|
||||
})
|
||||
brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
||||
acc += 100
|
||||
})
|
||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||
dec += 100
|
||||
})
|
||||
brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
|
||||
dec += -100
|
||||
})
|
||||
acc = 500
|
||||
steady = 1000
|
||||
acc = 500
|
||||
forever(function () {
|
||||
brick.showValue("acc", acc, 1)
|
||||
brick.showValue("steady", steady, 2)
|
||||
brick.showValue("dec", dec, 3)
|
||||
brick.showString("acc: left/right", 5)
|
||||
brick.showString("dec: up/down", 6)
|
||||
brick.showString("run large B: enter", 7)
|
||||
})
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
[tank](/reference/motors/synced/tank), [steer](/reference/motors/synced/steer), [stop](/reference/motors/motor/stop)
|
@ -1,22 +0,0 @@
|
||||
# Schedule
|
||||
|
||||
Schedules an acceleration, constant and deceleration phase at a given speed.
|
||||
|
||||
```sig
|
||||
motors.largeA.schedule(50, 100, 500, 100)
|
||||
```
|
||||
|
||||
The speed setting is a percentage of the motor's full speed. Full speed is the speed that the motor runs when the brick supplies maximum output voltage to the port.
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
* **speed**: a [number](/types/number) that is the percentage of full speed. A negative value runs the motor in the reverse direction.
|
||||
* **acceleration**: the [number](/types/number) of movement units to rotate for while accelerating.
|
||||
* **value**: the [number](/types/number) of movement units to rotate for.
|
||||
* **deceleration**: the [number](/types/number) of movement units to rotate for while decelerating.
|
||||
* **unit**: the movement unit of rotation. This can be `milliseconds`, `seconds`, `degrees`, or `rotations`. If the number for **value** is `0`, this parameter isn't used.
|
||||
|
||||
## See also
|
||||
|
||||
[tank](/reference/motors/synced/tank), [steer](/reference/motors/synced/steer), [stop](/reference/motors/motor/stop)
|
30
docs/reference/motors/motor/set-brake-settle-time.md
Normal file
@ -0,0 +1,30 @@
|
||||
# set Brake Settle Time
|
||||
|
||||
Set the time to wait after a motor stopped to allow it settle
|
||||
when brake is enabled. Default is 10ms.
|
||||
|
||||
```sig
|
||||
motors.largeA.setBrakeSettleTime(200)
|
||||
```
|
||||
|
||||
When a the motor is stopped and brake is applied, it can still wiggle for a little while. You can use the settle time to automatically way after stopping and let the robot settle.
|
||||
|
||||
## Parameters
|
||||
|
||||
* **time**: a [number](/types/number) value which represents the number of milliseconds to wait after braking.
|
||||
|
||||
## Example
|
||||
|
||||
Set the brake mode and the settle time to 500ms. Run the motor connected to port **A** for 2 seconds at a speed of `30` and stop after 2s.
|
||||
|
||||
```blocks
|
||||
motors.largeA.setBrake(true)
|
||||
motors.largeA.setBrakeSettleTime(500)
|
||||
motors.largeA.run(30)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
[stop](/reference/motors/motor/stop)
|
@ -1,28 +1,28 @@
|
||||
# set Brake
|
||||
|
||||
Set the brake on the motor so it won't turn when it has no power.
|
||||
Set the brake on the motor so it will brake when it finishes a brake command.
|
||||
|
||||
```sig
|
||||
motors.largeA.setBrake(false)
|
||||
```
|
||||
|
||||
When a the motor is stopped, it can still rotate if an external force is applied to it. This can happen, for example, if your're tanking your brick on a inclined surface and stop the motors. Gravity will push down on the brick and might cause it to start rolling again. You can prevent this movement by setting the brake.
|
||||
When a the motor is stopped, it can still rotate if an external force is applied to it. This can happen, for example, if you're tanking your brick on a inclined surface and stop the motors. Gravity will push down on the brick and might cause it to start rolling again. You can prevent this movement by setting the brake.
|
||||
|
||||
Also, you can use the brake to do simple skid steering for your brick.
|
||||
|
||||
## Paramters
|
||||
## Parameters
|
||||
|
||||
* **brake**: a [boolean](/types/boolean) value which is either `true` to set the brake on or `false` to set the brake off.
|
||||
|
||||
## Example
|
||||
|
||||
Run the motor connected to port **A** for 2 seconds at a speed of `30`. Stop and set the brake.
|
||||
Run the motor connected to port **A** for 2 seconds at a speed of `30` and stop after 2s.
|
||||
|
||||
```blocks
|
||||
motors.largeA.setBrake(true)
|
||||
motors.largeA.run(30)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
motors.largeA.setBrake(true)
|
||||
```
|
||||
|
||||
## See also
|
||||
|
@ -1,20 +0,0 @@
|
||||
# Set Run Acceleration Ramp
|
||||
|
||||
```sig
|
||||
motors.largeD.setRunAccelerationRamp(1, MoveUnit.Seconds)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
```blocks
|
||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||
motors.largeB.run(50, 6, MoveUnit.Rotations)
|
||||
})
|
||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||
motors.largeC.run(50, 6, MoveUnit.Seconds)
|
||||
})
|
||||
motors.largeB.setRunAccelerationRamp(360, MoveUnit.Degrees)
|
||||
motors.largeB.setRunDecelerationRamp(360, MoveUnit.Degrees)
|
||||
motors.largeC.setRunAccelerationRamp(2, MoveUnit.Seconds)
|
||||
motors.largeC.setRunDecelerationRamp(2, MoveUnit.Seconds)
|
||||
```
|
@ -1,20 +0,0 @@
|
||||
# Set Run Deceleration Ramp
|
||||
|
||||
```sig
|
||||
motors.largeD.setRunDecelerationRamp(1, MoveUnit.Seconds)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
```blocks
|
||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
||||
motors.largeB.run(50, 6, MoveUnit.Rotations)
|
||||
})
|
||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||
motors.largeC.run(50, 6, MoveUnit.Seconds)
|
||||
})
|
||||
motors.largeB.setRunAccelerationRamp(360, MoveUnit.Degrees)
|
||||
motors.largeB.setRunDecelerationRamp(360, MoveUnit.Degrees)
|
||||
motors.largeC.setRunAccelerationRamp(2, MoveUnit.Seconds)
|
||||
motors.largeC.setRunDecelerationRamp(2, MoveUnit.Seconds)
|
||||
```
|
26
docs/reference/motors/motor/set-run-phase.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Set Run Phase
|
||||
|
||||
Allows to specify an acceleration or deceleration phases for run commands.
|
||||
|
||||
```sig
|
||||
motors.largeD.setRunPhase(MovePhase.Acceleration, 1, MoveUnit.Seconds)
|
||||
```
|
||||
|
||||
Once the run phase is specified on a motor (or pair of motors),
|
||||
it will be automatically applied to [run](/reference/motors/run) commands.
|
||||
|
||||
## Time vs Rotation
|
||||
|
||||
The phases specified for time units (seconds, milliseconds) only apply to run with time
|
||||
moves. Similarly, the phases specified for rotation units (# rotation, degrees) only
|
||||
apply to run with rotation units.
|
||||
|
||||
## Examples
|
||||
|
||||
```blocks
|
||||
motors.largeB.setRunPhase(MovePhase.Acceleration, 0.5, MoveUnit.Seconds)
|
||||
motors.largeB.setRunPhase(MovePhase.Deceleration, 0.2, MoveUnit.Seconds)
|
||||
forever(function () {
|
||||
motors.largeB.run(50, 1, MoveUnit.Seconds)
|
||||
})
|
||||
```
|
25
docs/reference/motors/reset-all.md
Normal file
@ -0,0 +1,25 @@
|
||||
# reset All Motors
|
||||
|
||||
Reset all motors currently running on the brick.
|
||||
|
||||
```sig
|
||||
motors.resetAll();
|
||||
```
|
||||
|
||||
The motors counters are resetted.
|
||||
|
||||
## Example
|
||||
|
||||
Tank the EV3 Brick forward at half speed for 5 seconds and then stop.
|
||||
|
||||
```blocks
|
||||
motors.largeAB.tank(50, 50);
|
||||
pause(5000);
|
||||
motors.stopAll();
|
||||
motors.resetAll();
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
[stop all](/reference/motors/motor/stop-all),
|
||||
[reset](/reference/motors/motor/reset)
|
@ -22,4 +22,5 @@ motors.stopAll();
|
||||
|
||||
[stop](/reference/motors/motor/stop),
|
||||
[reset](/reference/motors/motor/reset),
|
||||
[reset-all](/reference/motors/motor/reset-all),
|
||||
[set brake](/reference/motors/motor/set-brake)
|
@ -22,7 +22,7 @@ If you decide to use a **value** of rotation distance, you need to choose a type
|
||||
|
||||
## Parameters
|
||||
|
||||
* **turnRatio**: a [number](/types/number) that is the percentage of speed of the drive motor. The follower motor runs at this speed. A negative number steers to the left and a positive number steers to the right. This is a number between `-100` and `100`.
|
||||
* **turnRatio**: a [number](/types/number) that is the percentage of speed of the drive motor. The follower motor runs at this speed. A negative number steers to the left and a positive number steers to the right. This is a number between `-200` and `200`.
|
||||
* **speed**: a [number](/types/number) that is the percentage of full speed. A negative value runs the motors in the reverse direction. This is the speed that the drive motor runs at.
|
||||
* **value**: the [number](/types/number) of movement units to rotate for. A value of `0` means run the motor continuously.
|
||||
* **unit**: the movement unit of rotation. This can be `milliseconds`, `seconds`, `degrees`, or `rotations`. If the number for **value** is `0`, this parameter isn't used.
|
||||
|
BIN
docs/static/MC-LEGO-loader-eyes.png
vendored
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
docs/static/Microsoft-logo_rgb_c-gray-square.png
vendored
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 911 B |
BIN
docs/static/Microsoft-logo_rgb_c-gray.png
vendored
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 13 KiB |
BIN
docs/static/Microsoft-logo_rgb_c-white.png
vendored
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 17 KiB |
BIN
docs/static/about/blocks-to-js.png
vendored
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
docs/static/about/blocks-toolbox.png
vendored
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 15 KiB |
BIN
docs/static/about/download-button.png
vendored
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
docs/static/about/explorer-button.png
vendored
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
docs/static/about/explorer-view.png
vendored
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
docs/static/about/help-button.png
vendored
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 781 B |
BIN
docs/static/about/home-button.png
vendored
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 607 B |
BIN
docs/static/about/more-settings.png
vendored
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 756 B |
BIN
docs/static/about/redo-button.png
vendored
Before Width: | Height: | Size: 981 B After Width: | Height: | Size: 472 B |
BIN
docs/static/about/save-project.png
vendored
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
docs/static/about/share-button.png
vendored
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 533 B |
BIN
docs/static/about/share-dialog.png
vendored
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 16 KiB |
BIN
docs/static/about/undo-button.png
vendored
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 463 B |
BIN
docs/static/about/zoom-in.png
vendored
Before Width: | Height: | Size: 1011 B After Width: | Height: | Size: 490 B |
BIN
docs/static/about/zoom-out.png
vendored
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 438 B |
BIN
docs/static/backgrounds/simulator.png
vendored
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 349 B |
BIN
docs/static/bluetooth/experimental.png
vendored
Normal file
After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 26 KiB |
BIN
docs/static/coding/line-detection/car-road-line.jpg
vendored
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 26 KiB |
BIN
docs/static/coding/object-detection/ev3-cuboid.jpg
vendored
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 26 KiB |
BIN
docs/static/coding/object-detection/road-deer.jpg
vendored
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 26 KiB |
BIN
docs/static/configurations/chrome-version.png
vendored
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.4 KiB |
BIN
docs/static/configurations/edge-version.png
vendored
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
docs/static/configurations/firefox-version.png
vendored
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 39 KiB |
BIN
docs/static/configurations/ie-version.png
vendored
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 11 KiB |
BIN
docs/static/configurations/osx-version.jpg
vendored
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/static/configurations/osx-version.png
vendored
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 89 KiB |
BIN
docs/static/configurations/safari-version.png
vendored
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 35 KiB |
BIN
docs/static/configurations/windows-version.png
vendored
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 51 KiB |
BIN
docs/static/download/firmware.png
vendored
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
docs/static/fll/code-js.png
vendored
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/static/fll/context-help.jpg
vendored
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 24 KiB |
BIN
docs/static/fll/fll-big.png
vendored
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
docs/static/fll/fll-logo.png
vendored
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 9.0 KiB |
BIN
docs/static/fll/import-button.jpg
vendored
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 40 KiB |
BIN
docs/static/fll/save-project.jpg
vendored
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 13 KiB |
BIN
docs/static/fll/share-button.jpg
vendored
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 8.4 KiB |
BIN
docs/static/fll/share-program.jpg
vendored
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 29 KiB |
BIN
docs/static/fll/share-program.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/static/fll/simulator.png
vendored
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/static/getting-started/01_EyesOn_Intro.png
vendored
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 92 KiB |
BIN
docs/static/getting-started/02_ApplePickerRobot.jpg
vendored
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 37 KiB |
BIN
docs/static/getting-started/02_PowerOn.png
vendored
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 95 KiB |
BIN
docs/static/getting-started/03_insert-usb-02.jpg
vendored
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
docs/static/getting-started/03_insert-usb-02.png
vendored
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 105 KiB |
BIN
docs/static/getting-started/05_EyesOn.png
vendored
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 74 KiB |
BIN
docs/static/getting-started/06_PlugInLargeMotor.jpg
vendored
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/static/getting-started/06_PlugInLargeMotor.png
vendored
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 105 KiB |
BIN
docs/static/getting-started/08_WorkingLargeMotor.png
vendored
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 86 KiB |
BIN
docs/static/getting-started/09_Connect_Touch.jpg
vendored
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
docs/static/getting-started/09_Connect_Touch.png
vendored
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 116 KiB |
BIN
docs/static/getting-started/11_TouchMotorWorking.png
vendored
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 99 KiB |
BIN
docs/static/getting-started/12_ConnectColor.jpg
vendored
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/static/getting-started/12_ConnectColor.png
vendored
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 103 KiB |
BIN
docs/static/getting-started/14_ColorSensorWorking.jpg
vendored
Normal file
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 101 KiB |
BIN
docs/static/getting-started/15_Use-it.jpg
vendored
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 45 KiB |
BIN
docs/static/getting-started/Try-in-file-manager.jpg
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
docs/static/getting-started/simulate.png
vendored
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 15 KiB |
BIN
docs/static/hero.jpg
vendored
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
docs/static/hero.png
vendored
Before Width: | Height: | Size: 481 KiB After Width: | Height: | Size: 347 KiB |
BIN
docs/static/icons/android-chrome-192x192.png
vendored
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 6.9 KiB |
BIN
docs/static/icons/android-chrome-256x256.png
vendored
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.9 KiB |
BIN
docs/static/icons/apple-touch-icon.png
vendored
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 4.6 KiB |
BIN
docs/static/icons/favicon-16x16.png
vendored
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 376 B |
BIN
docs/static/icons/favicon-32x32.png
vendored
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 837 B |