moving out outdated js docs

This commit is contained in:
Peli de Halleux
2016-04-15 14:37:25 -07:00
parent 6515cc0360
commit bb6ae00a49
153 changed files with 0 additions and 81 deletions

View File

@ -0,0 +1,84 @@
# basic LED show.
### Challenge 0
You have successfully following the [guided tutorial] (https://live.microbit.co.uk/td/tutorials/blink). If not, we should make sure the micro:bit script displays a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then you will clear the screen of the micro:bit. Let's give it a go!
```
while (true) {
led.plot(2, 2)
basic.pause(200)
basic.clearScreen()
basic.pause(200)
}
```
### Challenge 1
Use `basic->show string`  to display text after the blink. You will be writing a series of letters to display a series of letters. Try to unravel this secret code word: HELP. This line of code is within the  while  scope
Make sure to add this line of code within the `while` scope!
```
while (true) {
led1.plot(2, 2)
basic1.pause(200)
basic1.clearScreen()
basic1.pause(200)
basic1.showString("HELP", 150) // ***
}
```
* run the code and see that it works as expected
### Challenge 2
You can also display a number on screen using `basic>show number`. Add code under `basic>show string` to display the emergency number to call in the United Kingdom. (NOTE: 999 is the historic emergency number for the United Kingdom. All calls are answered by 999 operators. Calls are always free.)
```
while (true) {
led2.plot(2, 2)
basic2.pause(200)
basic2.clearScreen()
basic2.pause(200)
basic2.showString("HELP", 150)
basic2.showNumber(999, 150) // ***
}
```
Awesome! You have designed your message and a number to call in case of an emergency.
### Challenge 3
* tap the `run` button to view the updated script on the simulator
Add an associated animation after the emergency number . You can also create a cool animation on screen using `basic->show animation`. Add code under `basic->show number` to display an animation.
```
while (true) {
led3.plot(2, 2)
basic3.pause(200)
basic3.clearScreen()
basic3.pause(200)
basic3.showString("HELP", 150)
basic3.showNumber(999, 150)
basic3.showAnimation(`
# # . # #
. # . # .
. . # . .
# . . . #
# # # # #
`, 400) // ***
}
```
Awesome! We have implemented a string, number, and animation
* run the code and see that it works as expected.
### Challenge 4
Use the same logic `basic->string`, `basic->number`, or `basic->animation` to turn on the LEDs and display information!!!
* run the code and see that it works as expected

View File

@ -0,0 +1,109 @@
# blink symbols.
### Challenge 0
You have successfully following the [blink tutorial](/hcwxud). If not, then let's start the tutorial now. Your micro:bit script should start by displaying a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then clear the screen of the micro:bit.
Let's give it a go!
```
while (true) {
led.plot(2, 2)
basic.pause(200)
basic.clearScreen()
basic.pause(200)
}
```
### Challenge 1
Make a `>` greater than symbol. Start in the upper left corner of the simulator when you plot coordinates. Make sure to add the line of code `led->plot (0,0)` under the last line of code
```
while (true) {
led1.plot(2, 2)
basic1.pause(200)
basic1.clearScreen()
basic1.pause(200)
led1.plot(0, 0) // ***
}
```
Design the top half of the `>` symbol by connecting a LED to the original center coordinate `2,2` and the upper left coordinate `0,0` Make sure to add the line of code `led->plot (1,1)` under the last line of code
```
while (true) {
led2.plot(2, 2)
basic2.pause(200)
basic2.clearScreen()
basic2.pause(200)
led2.plot(0, 0)
led2.plot(1, 1) // ***
}
```
Awesome! You have designed half of the `>` symbol. Now we should finish the lower half of the `>` symbol
* tap the `run` button to view the updated script on the simulator
Add the bottom half of the `>` symbol by plotting the most bottom - left LED first. Make sure to add the line of code `led->plot (0,5)`
```
while (true) {
led3.plot(2, 2)
basic3.pause(200)
basic3.clearScreen()
basic3.pause(200)
led3.plot(0, 0)
led3.plot(1, 1)
led3.plot(0, 4) // ***
}
```
Awesome! Now we must connect a LED to the original center coordinate `2,2` and the lower left coordinate `0,5` Make sure to add the line of code `led->plot (1,4)`
Your `main` function should look like this:
```
while (true) {
led4.plot(2, 2)
basic4.pause(200)
basic4.clearScreen()
basic4.pause(200)
led4.plot(0, 0)
led4.plot(1, 1)
led4.plot(0, 4)
led4.plot(1, 3) // ***
}
```
* `run` the script and see that the program works as expected
Congratulations! You made a `>` symbol.
### Challenge 2
Use `led->plot` to create a exclamation design `!` Your `main` function should look like this. (notice the notation of `...` represents previous code in **Challenge 0** and **Challenge 1**
Make sure to add these lines of code within the `while` loop
Your `main` function should look like this:
```
while (true) {
// ...
led5.plot(4, 0) // ***
led5.plot(4, 1) // ***
led5.plot(4, 2) // ***
led5.plot(4, 4) // ***
}
```
* run the code and see that it works as expected.
### Challenge 3
Use the same logic `led->plot` to turn on all the LED lights!!!
* run the code and see that it works as expected

View File

@ -0,0 +1,43 @@
# Light Column Cascade Worksheet
My script. #docs
**Challenge 0**
Great Job! You have completed the Light Column Cascade tutorial having a nested for loop that plots each individual LED by column adding a delay between lighting each LED.
```
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
led.plot(i, j)
basic.pause(200)
}
}
```
**Challenge 1**
Make the board light up faster by making the pause less time.
```
for (let i1 = 0; i1 < 5; i1++) {
for (let j1 = 0; j1 < 5; j1++) {
led1.plot(i1, j1)
basic1.pause(100) // ***
}
}
```
**Challenge 2**
Make the board light up by rows instead of by columns by changing the i to the y position and j to the x position.
```
for (let i2 = 0; i2 < 5; i2++) {
for (let j2 = 0; j2 < 5; j2++) {
led2.plot(j2, i2) // ***
basic2.pause(100)
}
}
```

View File

@ -0,0 +1,43 @@
# Light Column Cascade Activity
My script. #docs
**Challenge 0**
Great Job! You have completed the Light Column Cascade tutorial having a nested for loop that plots each individual LED by column adding a delay between lighting each LED.
```
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
led.plot(i, j)
basic.pause(200)
}
}
```
**Challenge 1**
Make the board light up faster by making the pause less time.
```
for (let i1 = 0; i1 < 5; i1++) {
for (let j1 = 0; j1 < 5; j1++) {
led1.plot(i1, j1)
basic1.pause(100) // ***
}
}
```
**Challenge 2**
Make the board light up by rows instead of by columns by changing the i to the y position and j to the x position.
```
for (let i2 = 0; i2 < 5; i2++) {
for (let j2 = 0; j2 < 5; j2++) {
led2.plot(j2, i2) // ***
basic2.pause(100)
}
}
```

View File

@ -0,0 +1,22 @@
# Scroll Image Docs
My script. #docs
**Challenge 0**
This [guided tutorial](/xuhkviyyxa) introduces how to make an image look like it's scrolling across the micro:bit!
We can use an animation to make an image look like its moving!
```
basic.forever()
```
**Challenge 1**
Now, let's reverse the animation so it looks like the bar is bouncing off the right edge of the display.
```
basic1.forever()
```

View File

@ -0,0 +1,140 @@
# TouchDevelop Lessons
Overview of TouchDevelop lessons for the micro:bit.
### @section full
### ~column
### LED screen
* [plot guided](/hcwxud) `guided tutorial ` `video available`
* [plots an LED](/njuzbvocit) [guided tutorial]
* [blink symbols](/rfchtfjmag) `docs`
* [clear screen](/jwqywu)
* [point](/reference/led/point)
* [set brightness](/tfrmcgdtxk)
## micro:bit
## functions
### Basic
* [show number](/doxhko)
* [show string](/hgsfxg)
* [forever - show image](/bniyze) `guided tutorial`
* [forever - show animation - two frames 1a](/rwsjmubtaa)
* [forever - show animation - two frames 1c](/fomtaxxdkk)
* [forever - show animation - two frames 1 d](/huguhgjmmn)
* [forever - show animation - multliple frames](/tweyhx)
## Language {#pconst}
### Variables
* [global variables ](/nkecii) `guided tutorial`
* [local variable - create image, show image](/dcvnwv)
* data types: [number](/reference/types/number), [boolean](/reference/types/boolean), [string](/reference/types/string), [image](/reference/image/image)
### Statements and control structures
* [if](/reference/logic/if)
* [for](/reference/loops/for)
* [for loop nested - plot](/vpvhdnaqfm) **script**
* [while](/js/while)
* [while - show string, show number, show animation](/bidtzqdips) `docs`
* [while - create image ](/bnqbom)
* [return](/js/return)
* [break](/js/break)
* [function](/js/function)
* [assignment operation](/reference/variables/assign) `:=`
### Maths
* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [numbers](/reference/types/number)
* comparison operators (such as `>`, `=`) on [numbers](/reference/types/number)
* the [math](/js/math) library
* the [bits](/js/bits) library
### Logical
* boolean operators (`not`, `or`, `and`) on [booleans](/reference/types/boolean)
### Strings
* concat operator combines [strings](/reference/types/string)
### ~
### ~column
### Input
* [button is pressed](/reference/input/button-is-pressed)
* [on button pressed](/reference/input/on-button-pressed)
* [acceleration](/reference/input/acceleration)
* [compass heading](/reference/input/compass-heading)
* [calibrate](/functions/calibrate)
* [running time](/reference/input/running-time)
* [on shake](/reference/input/on-gesture)
* [on screen up](/functions/on-screen-up)
* [on screen down](/functions/on-screen-down)
* [on logo up](/functions/on-logo-up)
* [on logo down](/functions/on-logo-down)
### ~
### ~column
### Authoring & Other Bits
* [TouchDevelop editor](/js/editor)
* [markdown](/js/markdown)
* [creating interactive tutorials](/js/creatinginteractivetutorials)
* [run scripts in a web browser](/js/simulator)
* [run scripts on your micro:bit](/usb)
* [libraries](/js/libraries)
### Functions and libraries
* [creating functions](/js/function)
* [function parameters](/js/functionparameters)
* [calling functions](/js/call)
* [libraries](/js/libraries)
### Images
* [create image](/reference/images/create-image)
* [clear](/reference/basic/clear-screen)
* [set pixel](/reference/images/set-pixel)
* [pixel](/reference/images/pixel)
* [show image](/reference/images/show-image)
* [scroll image](/reference/images/scroll-image)
* [width](/functions/width)
* [show animation](/reference/basic/show-animation)
### Pins
* [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)
### Accessories
* [forever](/reference/basic/forever)
* [in background](/reference/control/in-background)
## Tutorials
* [Blink](/script:hcwxud)
* [Button](/script:rxqgzy)
* [Compass](/script:fhhhwl)
* [Counter](/script:bqrria)
* [Digital pet](/script:lsqwsk)
* [Flashing heart](/script:bniyze)
* [Glowing image](/script:hydyrp)
### ~