updating lessons
This commit is contained in:
parent
1e77491b16
commit
a14585d36f
@ -12,6 +12,8 @@ Variables
|
||||
|
||||
* [activity](/microbit/lessons/counter/activity)
|
||||
* [challenges](/microbit/lessons/counter/challenges)
|
||||
* [quiz](/microbit/lessons/counter/quiz)
|
||||
* [quiz answers](/microbit/lessons/counter/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
@ -12,7 +12,8 @@ If (Conditionals)
|
||||
|
||||
* [activity](/microbit/lessons/die-roll/activity)
|
||||
* [challenges](/microbit/lessons/die-roll/challenges)
|
||||
|
||||
* [quiz](/microbit/lessons/die-roll/quiz)
|
||||
* [quiz answers](/microbit/lessons/die-roll/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
@ -12,6 +12,8 @@ While Loop
|
||||
|
||||
* [activity](/microbit/lessons/digi-yoyo/activity)
|
||||
* [challenges](/microbit/lessons/digi-yoyo/challenges)
|
||||
* [quiz](/microbit/lessons/digi-yoyo/quiz)
|
||||
* [quiz answers](/microbit/lessons/digi-yoyo/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
@ -20,20 +22,12 @@ Learn how to creating a **while loop**, `while condition do` to repeat code whil
|
||||
## Documentation
|
||||
|
||||
```docs
|
||||
|
||||
let x = 0
|
||||
|
||||
basic.showNumber(0)
|
||||
|
||||
|
||||
while (true) {
|
||||
|
||||
basic.pause(20)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
## Objectives
|
||||
|
@ -18,7 +18,6 @@ let count = 0
|
||||
|
||||
Add a while loop that will loop over and over until the variable `count` equals 10.
|
||||
|
||||
![](/static/mb/blocks/lessons/digi-yoyo-1.jpg)
|
||||
|
||||
```blocks
|
||||
let count = 0
|
||||
|
@ -69,5 +69,7 @@ Now, we need `count` to decrease by one after the micro:bit has displayed the va
|
||||
We can do this by adding this line:
|
||||
|
||||
```blocks
|
||||
let count = count + (count - 1);
|
||||
let count = 0;
|
||||
count = count + (count - 1);
|
||||
|
||||
```
|
||||
|
@ -12,6 +12,8 @@ Math - Pick Random
|
||||
|
||||
* [activity](/microbit/lessons/guess-the-number/activity)
|
||||
* [challenges](/microbit/lessons/guess-the-number/challenges)
|
||||
* [quiz](/microbit/lessons/guess-the-number/quiz)
|
||||
* [quiz answers](/microbit/lessons/guess-the-number/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
@ -31,7 +31,7 @@ let randomNumber = Math.random(10)
|
||||
If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
|
||||
|
||||
```blocks
|
||||
randomNumber = Math.random(10)
|
||||
let randomNumber = Math.random(10)
|
||||
```
|
||||
|
||||
|
||||
|
@ -12,6 +12,9 @@ For Loop
|
||||
|
||||
* [activity](/microbit/lessons/looper/activity)
|
||||
* [challenges](/microbit/lessons/looper/challenges)
|
||||
* [quiz](/microbit/lessons/looper/quiz)
|
||||
* [quiz answers](/microbit/lessons/looper/quiz-answers)
|
||||
|
||||
|
||||
## Class
|
||||
|
||||
|
@ -10,6 +10,8 @@ If (Conditionals)
|
||||
|
||||
* [activity](/microbit/lessons/magic-8/activity)
|
||||
* [challenges](/microbit/lessons/magic-8/challenges)
|
||||
* [quiz](/microbit/lessons/magic-8/quiz)
|
||||
* [quiz answers](/microbit/lessons/magic-8/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
@ -28,7 +30,6 @@ input.onGesture(Gesture.Shake, () => {
|
||||
basic.showNumber(7)
|
||||
basic.clearScreen()
|
||||
basic.showString("Hello!")
|
||||
|
||||
```
|
||||
|
||||
## Objectives
|
||||
|
@ -25,12 +25,13 @@ let x = Math.random(3)
|
||||
## 3. Write the 'if statement' to check if ``x`` is equal to 2. Inside the 'if statement', display the string "Yes".
|
||||
|
||||
```blocks
|
||||
let x = Math.random(3)
|
||||
if (x == 2) {
|
||||
basic.showString("Yes", 150)
|
||||
}
|
||||
```
|
||||
|
||||
## 3. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No."
|
||||
## 4. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No."
|
||||
|
||||
```blocks
|
||||
let x = Math.random(3)
|
||||
|
@ -22,7 +22,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
|
||||
|
||||
<br />
|
||||
|
||||
## 3. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No."
|
||||
## 4. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No."
|
||||
|
||||
<br />
|
||||
|
||||
|
@ -12,6 +12,8 @@ On Logo Up
|
||||
|
||||
* [activity](/microbit/lessons/magic-logo/activity)
|
||||
* [challenges](/microbit/lessons/magic-logo/challenges)
|
||||
* [quiz](/microbit/lessons/magic-logo/challenges)
|
||||
* [quiz answers](/microbit/lessons/magic-logo/challenges)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
@ -12,6 +12,8 @@ Set Brightness
|
||||
|
||||
* [activity](/microbit/lessons/night-light/activity)
|
||||
* [challenges](/microbit/lessons/night-light/challenges)
|
||||
* [quiz](/microbit/lessons/night-light/quiz)
|
||||
* [quiz answers](/microbit/lessons/night-light/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
@ -16,9 +16,15 @@ If the rectangle above represents the BBC micro:bit, write the code to set all t
|
||||
|
||||
<br />
|
||||
|
||||
```
|
||||
```blocks
|
||||
led.setBrightness(255)
|
||||
led.plotAll()
|
||||
basic.showLeds(`
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
`)
|
||||
```
|
||||
|
||||
## 3. Consider the following image
|
||||
@ -29,9 +35,15 @@ If the rectangle above represents the BBC micro:bit, write the code to set the s
|
||||
|
||||
<br/>
|
||||
|
||||
```
|
||||
```blocks
|
||||
led.setBrightness(128)
|
||||
led.plotAll()
|
||||
basic.showLeds(`
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
`)
|
||||
```
|
||||
|
||||
## 4. Consider the following image
|
||||
@ -40,7 +52,7 @@ led.plotAll()
|
||||
|
||||
If the rectangle above represents the BBC micro:bit, write the code to turn off all the LEDs.
|
||||
|
||||
```
|
||||
```blocks
|
||||
led.setBrightness(0)
|
||||
```
|
||||
|
||||
|
@ -10,10 +10,8 @@ While Loop
|
||||
|
||||
* [activity](/microbit/lessons/rotation-animation/activity)
|
||||
* [challenges](/microbit/lessons/rotation-animation/challenges)
|
||||
|
||||
## Class
|
||||
|
||||
Year 7
|
||||
* [quiz](/microbit/lessons/rotation-animation/quiz)
|
||||
* [quiz answers](/microbit/lessons/rotation-animation/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
@ -38,17 +36,14 @@ while (true) {
|
||||
|
||||
basic.pause(20)
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
## Objectives
|
||||
|
||||
* learn how to create a global variable for a place where you can store data, accessible across functions, and in nested code blocks
|
||||
* learn how to set or change the value of a global variable
|
||||
* learn how to create a variable for a place where you can store data, accessible across functions, and in nested code blocks
|
||||
* learn how to set or change the value of a variable
|
||||
* learn how to repeat code while a condition is true
|
||||
* learn how to declare a global boolean variable to determine which code will execute next
|
||||
* learn how to declare a boolean variable to determine which code will execute next
|
||||
* learn how to run code when an input button is pressed
|
||||
* learn how to show a series of image frames on the LED screen
|
||||
* learn how to pause your code for the specified number of milliseconds
|
||||
|
@ -54,9 +54,6 @@ Now let's add to this by creating a condition for on button pressed `A` before t
|
||||
```blocks
|
||||
|
||||
let rotating = true;
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
serial.writeLine("hello")
|
||||
})
|
||||
while (rotating) {
|
||||
serial.writeLine("loop")
|
||||
basic.showLeds(`
|
||||
@ -88,8 +85,9 @@ while (rotating) {
|
||||
. . . . .
|
||||
`)
|
||||
}
|
||||
|
||||
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
serial.writeLine("hello")
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
@ -101,10 +99,6 @@ Now that we have the on button pressed condition, let's make the animation stop
|
||||
|
||||
```blocks
|
||||
let rotating = true;
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
serial.writeLine("hello")
|
||||
rotating = false
|
||||
})
|
||||
while (rotating) {
|
||||
serial.writeLine("loop")
|
||||
basic.showLeds(`
|
||||
@ -136,7 +130,10 @@ while (rotating) {
|
||||
. . . . .
|
||||
`)
|
||||
}
|
||||
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
serial.writeLine("hello")
|
||||
rotating = false
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
|
@ -12,6 +12,8 @@ If (Conditionals)
|
||||
|
||||
* [activity](/microbit/lessons/spinner/activity)
|
||||
* [challenges](/microbit/lessons/spinner/challenges)
|
||||
* [quiz](/microbit/lessons/spinner/quiz)
|
||||
* [quiz answers](/microbit/lessons/spinner/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
@ -12,6 +12,8 @@ For Loop
|
||||
|
||||
* [activity](/microbit/lessons/strobe-light/activity)
|
||||
* [challenges](/microbit/lessons/strobe-light/challenges)
|
||||
* [quiz](/microbit/lessons/strobe-light/quiz)
|
||||
* [quiz answers](/microbit/lessons/strobe-light/quiz-answers)
|
||||
|
||||
## Documentation
|
||||
|
||||
|
@ -45,7 +45,14 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
The pause will add a delay between lighting each LED.
|
||||
|
||||
![](/static/mb/blocks/lessons/strobe-light-3.jpg)
|
||||
```blocks
|
||||
for (let i = 0; i < 5; i++) {
|
||||
for (let j = 0; j < 5; j++) {
|
||||
led.plot(i, j)
|
||||
basic.pause(200)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
|
@ -12,6 +12,8 @@ If (Conditionals)
|
||||
|
||||
* [activity](/microbit/lessons/truth-or-dare/activity)
|
||||
* [challenges](/microbit/lessons/truth-or-dare/challenges)
|
||||
* [quiz](/microbit/lessons/truth-or-dare/quiz)
|
||||
* [quiz answers](/microbit/lessons/truth-or-dare/quiz-answers)
|
||||
|
||||
## Prior learning/place of lesson in scheme of work
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user