2017-06-29 16:47:26 +02:00
|
|
|
# About
|
|
|
|
|
|
|
|
Welcome to the **Microsoft MakeCode** editor for the **@boardname@**!
|
|
|
|
|
|
|
|
## Programming: [Blocks](/blocks) or [JavaScript](/javascript)
|
|
|
|
|
|
|
|
You can program the @boardname@ using [Blocks](/blocks) or [JavaScript](/javascript) in your web browser:
|
|
|
|
|
2018-01-19 01:43:16 +01:00
|
|
|
```blocks
|
2018-01-31 17:28:00 +01:00
|
|
|
brick.buttonEnter.onEvent(ButtonEvent.Bumped, () => {
|
2018-02-19 16:35:08 +01:00
|
|
|
motors.largeA.run(50)
|
2017-06-29 16:47:26 +02:00
|
|
|
})
|
|
|
|
```
|
|
|
|
```typescript
|
2018-01-31 17:28:00 +01:00
|
|
|
brick.buttonEnter.onEvent(ButtonEvent.Bumped, () => {
|
2018-02-19 16:35:08 +01:00
|
|
|
motors.largeA.run(50)
|
2017-06-29 16:47:26 +02:00
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
The editor work in [most modern browsers](/browsers), work [offline](/offline) once loaded and do not require any installation.
|
|
|
|
|
2018-02-03 18:09:10 +01:00
|
|
|
## Compile and Flash: Your Program!
|
2017-06-29 16:47:26 +02:00
|
|
|
|
|
|
|
When you have your code ready, you connect your @boardname@ to a computer via a USB cable
|
2018-01-19 01:43:16 +01:00
|
|
|
so it appears as a mounted drive (named **EV3**).
|
2017-06-29 16:47:26 +02:00
|
|
|
|
|
|
|
Compilation to machine code from [Blocks](/blocks) or [JavaScript](/javascript) happens in the browser. You save the binary
|
2018-01-19 01:43:16 +01:00
|
|
|
program to a **.uf2** file, which you then copy to the **EV3** drive, which flashes the device with the new program.
|
2017-06-29 16:47:26 +02:00
|
|
|
|
|
|
|
## Simulator: Test Your Code
|
|
|
|
|
|
|
|
You can run your code using the micro:bit simulator, all within the confines of a web browser.
|
|
|
|
The simulator has support for the LED screen, buttons, as well as compass, accelerometer, and digital I/O pins.
|
|
|
|
|
|
|
|
```sim
|
2018-01-31 17:28:00 +01:00
|
|
|
brick.buttonEnter.onEvent(ButtonEvent.Bumped, () => {
|
2018-02-19 16:35:08 +01:00
|
|
|
motors.largeA.run(50)
|
2017-06-29 16:47:26 +02:00
|
|
|
})
|
|
|
|
```
|