various docs cleanup
@ -7,10 +7,16 @@ Register an event that will execute whenever the user attaches one side of the c
|
||||
|
||||
This example displays a random number every time the crocodile clip holds `GND` then connects and disconnects the `P0` pin. Each time the crocodile clip is firmly connected and disconnected from pin `P0`, the micro:bit will return a random Number between 0 and the parameter limit
|
||||
|
||||

|
||||
```blocks
|
||||
input.onPinPressed(TouchPin.P0, () => {
|
||||
basic.showNumber(Math.random(10))
|
||||
})
|
||||
```
|
||||
|
||||
### Connecting Crocodile Clips
|
||||
|
||||

|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
|
18
docs/offline.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Offline editing
|
||||
|
||||
## Web application
|
||||
|
||||
**https://codethemicrobit.com is an HTML5 web application** that automatically gets cached locally by your browser.
|
||||
Once the web app is loaded and you have compiled at least once, you will have all the code needed to work without an internet connection.
|
||||
|
||||
## Command line interface
|
||||
|
||||
For more experience users, you can download the entire toolchain and use the [command line interface](/cli) (CLI) to compile
|
||||
and deploy your scripts locally. PXT provides a great out-of-the-box experience using [Visual Studio Code](/code),
|
||||
a lightweight cross-platform code editor.
|
||||
|
||||

|
||||
|
||||
## Native clients
|
||||
|
||||
There are no native clients available yet.
|
@ -11,11 +11,16 @@ An *Image* is a matrix of pixels to show on the [LED screen](/device/screen)
|
||||
To display an image:
|
||||
|
||||
* click `Basic` , `Show LEDs`, and tap on the LEDs`
|
||||
* when you're done, return to your code
|
||||
|
||||

|
||||
|
||||
You should see code similar to this:
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`)
|
||||
```
|
||||
|
||||
### Creating an image
|
||||
|
||||
|
@ -20,7 +20,11 @@ led.plot(2, 2)
|
||||
led.toggleAll()
|
||||
```
|
||||
|
||||

|
||||
```sim
|
||||
basic.clearScreen()
|
||||
led.plot(2, 2)
|
||||
led.toggleAll()
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
# Off-line support
|
||||
|
||||
The micro:bit pins.
|
||||
|
||||
## How to work offline
|
||||
|
||||
If you have loaded the web app at some time in the past (by clicking on "my scripts" from the home page), then if you later open the same browser (whether you are online or offline) and type in [https://codethemicrobit.com/](https://codethemicrobit.com/), you will be able to access all the features of the web app. Note that it is important to end the URL with "/".
|
||||
|
||||
## Save and load code using files
|
||||
|
||||

|
||||
|
||||
The micro:bit automatically saves and synchronises scripts for signed-in users through the cloud. We also decided to also support file save/load for offline support and sharing via email and other storage providers. Users are now able to import and export scripts as files. For example, they can simply email it or submit them in their classroom portal.
|
||||
|
||||

|
||||
|
||||
## The new in-browser compiler
|
||||
|
||||
The compilation from a script to ARM machine code is now done entirely in the browser (read the [in depth story](https://www.touchdevelop.com/docs/touch-develop-in-208-bits) about building the compiler). The new compiler is used by the Block Editor, Touch Develop and Code Kingdoms to create a .hex file solely within the confines of your web browser (no Internet connection is needed). The micro:bit compilation process is shown below:
|
||||
|
||||

|
||||
|
||||
The C++ compiler is now only used to compile the micro:bit runtime - this is done offline by the micro:bit team and the pre-compiled runtime is linked with your compiled script in the browser.
|
||||
|
||||
Compiled .hex files can also be imported back into the web site. This make it easy for a teacher to review the source of a script by simply drag and dropping the file into the editor.
|
||||
|
BIN
docs/static/mb/antenna-0.png
vendored
Before Width: | Height: | Size: 2.7 KiB |
BIN
docs/static/mb/boolean-0.png
vendored
Before Width: | Height: | Size: 2.4 KiB |
BIN
docs/static/mb/boolean-1.png
vendored
Before Width: | Height: | Size: 6.7 KiB |
BIN
docs/static/mb/boolean-2.png
vendored
Before Width: | Height: | Size: 12 KiB |
BIN
docs/static/mb/change-0.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
docs/static/mb/change-score-by-0.png
vendored
Before Width: | Height: | Size: 5.8 KiB |
BIN
docs/static/mb/create-sprite-0.png
vendored
Before Width: | Height: | Size: 5.1 KiB |
BIN
docs/static/mb/crocodile-clips-0.png
vendored
Before Width: | Height: | Size: 9.9 KiB |
BIN
docs/static/mb/crocodile-clips-2.jpg
vendored
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 97 KiB |
BIN
docs/static/mb/csv.png
vendored
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
docs/static/mb/data-4.png
vendored
Before Width: | Height: | Size: 9.6 KiB |
BIN
docs/static/mb/events-0.png
vendored
Before Width: | Height: | Size: 3.9 KiB |
BIN
docs/static/mb/hourofcode-0.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
docs/static/mb/object-disclaimer-0.png
vendored
Before Width: | Height: | Size: 13 KiB |
BIN
docs/static/mb/object-types-0.png
vendored
Before Width: | Height: | Size: 8.4 KiB |
BIN
docs/static/mb/object-types-1.png
vendored
Before Width: | Height: | Size: 14 KiB |
BIN
docs/static/mb/offline-0.png
vendored
Before Width: | Height: | Size: 12 KiB |
BIN
docs/static/mb/offline-1.png
vendored
Before Width: | Height: | Size: 6.3 KiB |
BIN
docs/static/mb/on-gamepad-button-0.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
docs/static/mb/on-signal-strength-changed-0.png
vendored
Before Width: | Height: | Size: 6.9 KiB |
BIN
docs/static/mb/plot-leds-0.png
vendored
Before Width: | Height: | Size: 16 KiB |
BIN
docs/static/mb/raise-alert-to-0.png
vendored
Before Width: | Height: | Size: 5.2 KiB |
BIN
docs/static/mb/receive-number-0.png
vendored
Before Width: | Height: | Size: 2.4 KiB |
BIN
docs/static/mb/scroll-image-0.png
vendored
Before Width: | Height: | Size: 6.6 KiB |
BIN
docs/static/mb/show-image-0.png
vendored
Before Width: | Height: | Size: 4.0 KiB |
BIN
docs/static/mb/signal-strength-0.png
vendored
Before Width: | Height: | Size: 2.5 KiB |
BIN
docs/static/mb/simulator-0.png
vendored
Before Width: | Height: | Size: 199 KiB |
BIN
docs/static/mb/string-0.png
vendored
Before Width: | Height: | Size: 2.3 KiB |
BIN
docs/static/mb/tell-camera-to-0.png
vendored
Before Width: | Height: | Size: 5.4 KiB |
BIN
docs/static/mb/tell-microphone-to-0.png
vendored
Before Width: | Height: | Size: 3.9 KiB |
BIN
docs/static/mb/tell-remote-control-to-0.png
vendored
Before Width: | Height: | Size: 4.4 KiB |
BIN
docs/static/mb/toggle-all-0.png
vendored
Before Width: | Height: | Size: 262 KiB |