From 21361708ec260f5fbd27d1a40d4affd01d3c12b2 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Fri, 20 May 2016 13:09:18 -0700 Subject: [PATCH] Rest of Basic in simple English. Reconsider some code samples? --- docs/reference/basic/forever.md | 18 +++++++++++++----- docs/reference/basic/pause.md | 9 ++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/reference/basic/forever.md b/docs/reference/basic/forever.md index 9b4a0a24..c666badc 100644 --- a/docs/reference/basic/forever.md +++ b/docs/reference/basic/forever.md @@ -1,6 +1,7 @@ # Forever -Repeat code [in the background](/reference/control/in-background) forever. +Keep running part of a program +[in the background](/reference/control/in-background). ```sig basic.forever(() => { @@ -9,7 +10,9 @@ basic.forever(() => { ### Example: compass -The following example constantly checks the [compass heading](/reference/input/compass-heading) and updates the screen with the direction. +The following example constantly checks the +[compass heading](/reference/input/compass-heading) +and updates the screen with the direction. ```blocks basic.forever(() => { @@ -30,7 +33,9 @@ basic.forever(() => { ### Example: counter -The following example continually shows the current value of a global variable: +The following example keeps showing the [number](/reference/types/number) stored in a global variable. +When you press button `A`, the number gets bigger. +You can use a program like this to count things with your BBC micro:bit. ```blocks let num = 0 @@ -42,9 +47,12 @@ input.onButtonPressed(Button.A, () => { }) ``` -### Contention for the LED display +### Competing for the LED screen -If you have multiple processes that each show something on the LED screen, you may get unexpected results. Try, for example: +If different parts of a program are each trying +to show something on the LED screen at the same time, +you may get unexpected results. +Try this on your micro:bit: ```blocks basic.forever(() => { diff --git a/docs/reference/basic/pause.md b/docs/reference/basic/pause.md index 776be176..a6bb0d10 100644 --- a/docs/reference/basic/pause.md +++ b/docs/reference/basic/pause.md @@ -1,6 +1,7 @@ # Pause -Pause program execution for the specified number of milliseconds. This function is helpful when you need to slow down your program's execution. +Pause the program for the number of milliseconds you say. +You can use this function to slow your program down. ```sig basic.pause(400) @@ -8,11 +9,13 @@ basic.pause(400) ### Parameters -* ``ms`` - the number of milliseconds that you want to pause (100 = 1/10 second, 1000 milliseconds = 1 second) +* ``ms`` is the number of milliseconds that you want to pause (100 milliseconds = 1/10 second, and 1000 milliseconds = 1 second). ### Example: diagonal line -The following example code turns on LED `0, 0` thru `4, 4`, pausing 500 milliseconds after each LED. Without `pause`, the code would run so fast that you wouldn't see each individual LED turning on. +This example draws a diagonal line by turning on LED `0, 0` (top left) through LED `4, 4` (bottom right). +The program pauses 500 milliseconds after turning on each LED. +Without `pause`, the program would run so fast that you would not have time to see each LED turning on. ```blocks for (let i = 0; i < 5; i++) {