From 4cc7215d3551ebaa17aa0269c7a5e7ef71e5ddfa Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Fri, 8 Jul 2016 16:34:56 -0700 Subject: [PATCH] Updated Linux (and Windows) instructions --- docs/device/serial.md | 27 ++++++++++++++++++--------- docs/reference/game/touching.md | 11 ++++++++--- docs/reference/led/stop-animation.md | 16 +++++++++++++++- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/docs/device/serial.md b/docs/device/serial.md index 4d5cd48f..f6fecc7a 100644 --- a/docs/device/serial.md +++ b/docs/device/serial.md @@ -33,9 +33,16 @@ If you are using the Google Chrome browser, you can use our extension to get ser ### Windows -You must install a device driver (for the computer to recognize the serial interface of the micro:bit); then, you must also install a terminal emulator (which is going to connect to the micro:bit and read its output). Here's how to do it: +You must install a device driver (for the computer to recognize the +serial interface of the micro:bit); then, you must also install a +terminal emulator (which is going to connect to the micro:bit and read +its output). -* Follow instructions at https://developer.mbed.org/handbook/Windows-serial-configuration in order to install the device driver +* Follow the instructions at + https://developer.mbed.org/handbook/Windows-serial-configuration to + install the device driver. + +* Instructions for installing a terminal emulator are below. #### Windows > Tera Term @@ -66,14 +73,16 @@ If you prefer another terminal emulator (such as [PuTTY](http://www.putty.org/)) ### Linux -(Untested). +* Install the program `screen` if it is not already installed. +* Plug in the micro:bit. +* Open a terminal. +* Find which device node the micro:bit was assigned to with the command `ls /dev/ttyACM*`. +* If it was `/dev/ttyACM0`, type the command `screen /dev/ttyACM0 115200`. If it was some other device node, + use that one in the command instead. **Note:** You may need root access to run `screen` + successfully. You can probably use the command `sudo` like this: `sudo screen /dev/ttyACM0 115200`. +* To exit `screen`, type `Ctrl-A` `Ctrl-D`. -* Plug in the micro:bit -* Open a terminal -* `dmesg | tail` will show you which `/dev/` node the micro:bit was assigned (e.g. `/dev/ttyUSB0`) -* Then, do: `screen /dev/ttyUSB0 115200` (install the `screen` program if you don't have it). To exit, run `Ctrl-A` `Ctrl-D`. - -Alternative programs include minicom, etc. +Alternative programs include `minicom` and so on. ### Mac OS diff --git a/docs/reference/game/touching.md b/docs/reference/game/touching.md index ea526b94..afe6962a 100644 --- a/docs/reference/game/touching.md +++ b/docs/reference/game/touching.md @@ -2,7 +2,12 @@ Reports true if sprite is touching specified sprite +```blocks +let matter = game.createSprite(2, 2); +let antimatter = game.createSprite(2, 2); +if (matter.isTouching(antimatter)) { + basic.pause(500); + basic.clearScreen(); + basic.showString("BOOM!"); +} ``` -export function isTouching(_this: micro_bitSprites.LedSprite, other: micro_bitSprites.LedSprite) : boolean -``` - diff --git a/docs/reference/led/stop-animation.md b/docs/reference/led/stop-animation.md index e07599ae..af7d9d4b 100644 --- a/docs/reference/led/stop-animation.md +++ b/docs/reference/led/stop-animation.md @@ -1,8 +1,22 @@ # Stop Animation -Cancels the current animation and clears other pending animations . +Stop the animation that is playing and any animations that are waiting to +play. ```sig led.stopAnimation() ``` +### Example + +This program... + +```blocks +basic.showString("STOP ME! STOP ME! PLEASE, WON'T SOMEBODY STOP ME?"); +input.onButtonPressed(Button.B, () => { + led.stopAnimation(); +}); +'``` +### See Also + +