Migrate docs from the other repo
This commit is contained in:
26
docs/reference/js/lessons/lucky-7/activity.md
Normal file
26
docs/reference/js/lessons/lucky-7/activity.md
Normal file
@ -0,0 +1,26 @@
|
||||
# lucky 7 activity
|
||||
|
||||
show a number on the LED screen. #docs #tutorials #stepByStep
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
### @video td/videos/lucky-7-0
|
||||
|
||||
Let's learn how to show the lucky number 7 on the LED screen.
|
||||
|
||||
### ~
|
||||
|
||||
To create a new script, go to the [Create Code](https://www.microbit.co.uk/create-code) page and tap `New Project` under **Touch Develop**.
|
||||
|
||||
We will use `basic->show number` to display a number on the screen. The first argument (`7`) is the number to display and the second argument (`150`) is duration in milliseconds between column scroll. For example, you can reduce `150` to `100` to speed up the scrolling.
|
||||
|
||||
```
|
||||
basic.showNumber(7, 150) // ***
|
||||
```
|
||||
|
||||
### ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/microbit/lessons/lucky-7/challenges)!
|
||||
|
||||
### ~
|
||||
|
39
docs/reference/js/lessons/lucky-7/challenges.md
Normal file
39
docs/reference/js/lessons/lucky-7/challenges.md
Normal file
@ -0,0 +1,39 @@
|
||||
# lucky 7 challenges
|
||||
|
||||
Coding challenges for the lucky 7 tutorial. #docs
|
||||
|
||||
## Before we get started
|
||||
|
||||
Complete the [lucky 7](/microbit/lessons/lucky-7/activity) activity and your code will look like this:
|
||||
|
||||
```
|
||||
basic.showNumber(7, 150)
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
|
||||
But we also should pause before showing another number. Let's add a pause of 500 milliseconds.
|
||||
|
||||
```
|
||||
basic.showNumber(7, 150)
|
||||
basic.pause(500) // ***
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
|
||||
### @video td/videos/lucky-7-1-2
|
||||
|
||||
What about other multiples of 7? Let's display the next multiple of 7 on the screen!
|
||||
|
||||
```
|
||||
basic.showNumber(7, 150)
|
||||
basic.pause(500)
|
||||
basic.showNumber(14, 150) // ***
|
||||
```
|
||||
|
||||
* Run the code to see if it works as expected.
|
||||
|
||||
### Challenge 3
|
||||
|
||||
Keep displaying multiples of 7 such as 21 and 28, but don't forget to add pauses between the numbers!
|
||||
|
38
docs/reference/js/lessons/lucky-7/quiz-answers.md
Normal file
38
docs/reference/js/lessons/lucky-7/quiz-answers.md
Normal file
@ -0,0 +1,38 @@
|
||||
# lucky 7 quiz answers
|
||||
|
||||
Show a number on the BBC micro:bit. #LED #screen #show #math #docs #input
|
||||
|
||||
This is the answer key for the [lucky 7 quiz](/microbit/lessons/lucky-7/quiz).
|
||||
|
||||
## 1. Describe what `basic->show number` does?
|
||||
|
||||
Answers may vary. This will show a number on the LED screen, one digit at a time (scrolling from left to right).
|
||||
|
||||
## 2. Draw every LED that is ON after running this code
|
||||
|
||||
```
|
||||
basic.showNumber(7, 150)
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||

|
||||
|
||||
## 3. Draw every LED that is ON after running this code
|
||||
|
||||
```
|
||||
basic.showNumber(21, 150)
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 4. Write the code that will be used to display the number 3 on the BBC micro:bit.
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
```
|
||||
basic.showNumber(3, 150)
|
||||
```
|
||||
|
44
docs/reference/js/lessons/lucky-7/quiz.md
Normal file
44
docs/reference/js/lessons/lucky-7/quiz.md
Normal file
@ -0,0 +1,44 @@
|
||||
# lucky 7 quiz
|
||||
|
||||
Show a number on the BBC micro:bit. #LED #screen #show #math #docs #input
|
||||
|
||||
## Name
|
||||
|
||||
## Directions
|
||||
|
||||
Use this activity document to guide your work in the [lucky 7 tutorial](/microbit/lessons/lucky-7/tutorial).
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
## 1. Describe what "basic->show number" does?
|
||||
|
||||
<br/>
|
||||
|
||||
## 2. Draw every LED that is ON after running this code
|
||||
|
||||
```
|
||||
basic.showNumber(7, 150)
|
||||
```
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
## 3. Draw every LED that is ON after running this code
|
||||
|
||||
```
|
||||
basic.showNumber(21, 150)
|
||||
```
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
## 4. Write the code that will be used to display the number 3 on the BBC micro:bit.
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
<br/>
|
||||
|
Reference in New Issue
Block a user