updating lessons

This commit is contained in:
Michael Elliot Braun 2016-03-30 15:54:19 -07:00
parent 1e77491b16
commit a14585d36f
20 changed files with 67 additions and 41 deletions

View File

@ -12,6 +12,8 @@ Variables
* [activity](/microbit/lessons/counter/activity) * [activity](/microbit/lessons/counter/activity)
* [challenges](/microbit/lessons/counter/challenges) * [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 ## Prior learning/place of lesson in scheme of work

View File

@ -12,7 +12,8 @@ If (Conditionals)
* [activity](/microbit/lessons/die-roll/activity) * [activity](/microbit/lessons/die-roll/activity)
* [challenges](/microbit/lessons/die-roll/challenges) * [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 ## Prior learning/place of lesson in scheme of work

View File

@ -12,6 +12,8 @@ While Loop
* [activity](/microbit/lessons/digi-yoyo/activity) * [activity](/microbit/lessons/digi-yoyo/activity)
* [challenges](/microbit/lessons/digi-yoyo/challenges) * [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 ## 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 ## Documentation
```docs ```docs
let x = 0 let x = 0
basic.showNumber(0) basic.showNumber(0)
while (true) { while (true) {
basic.pause(20) basic.pause(20)
} }
``` ```
## Objectives ## Objectives

View File

@ -18,7 +18,6 @@ let count = 0
Add a while loop that will loop over and over until the variable `count` equals 10. 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 ```blocks
let count = 0 let count = 0

View File

@ -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: We can do this by adding this line:
```blocks ```blocks
let count = count + (count - 1); let count = 0;
count = count + (count - 1);
``` ```

View File

@ -12,6 +12,8 @@ Math - Pick Random
* [activity](/microbit/lessons/guess-the-number/activity) * [activity](/microbit/lessons/guess-the-number/activity)
* [challenges](/microbit/lessons/guess-the-number/challenges) * [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 ## Prior learning/place of lesson in scheme of work

View File

@ -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. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
```blocks ```blocks
randomNumber = Math.random(10) let randomNumber = Math.random(10)
``` ```

View File

@ -12,6 +12,9 @@ For Loop
* [activity](/microbit/lessons/looper/activity) * [activity](/microbit/lessons/looper/activity)
* [challenges](/microbit/lessons/looper/challenges) * [challenges](/microbit/lessons/looper/challenges)
* [quiz](/microbit/lessons/looper/quiz)
* [quiz answers](/microbit/lessons/looper/quiz-answers)
## Class ## Class

View File

@ -10,6 +10,8 @@ If (Conditionals)
* [activity](/microbit/lessons/magic-8/activity) * [activity](/microbit/lessons/magic-8/activity)
* [challenges](/microbit/lessons/magic-8/challenges) * [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 ## Prior learning/place of lesson in scheme of work
@ -28,7 +30,6 @@ input.onGesture(Gesture.Shake, () => {
basic.showNumber(7) basic.showNumber(7)
basic.clearScreen() basic.clearScreen()
basic.showString("Hello!") basic.showString("Hello!")
``` ```
## Objectives ## Objectives

View File

@ -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". ## 3. Write the 'if statement' to check if ``x`` is equal to 2. Inside the 'if statement', display the string "Yes".
```blocks ```blocks
let x = Math.random(3)
if (x == 2) { if (x == 2) {
basic.showString("Yes", 150) 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 ```blocks
let x = Math.random(3) let x = Math.random(3)

View File

@ -22,7 +22,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
<br /> <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 /> <br />

View File

@ -12,6 +12,8 @@ On Logo Up
* [activity](/microbit/lessons/magic-logo/activity) * [activity](/microbit/lessons/magic-logo/activity)
* [challenges](/microbit/lessons/magic-logo/challenges) * [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 ## Prior learning/place of lesson in scheme of work

View File

@ -12,6 +12,8 @@ Set Brightness
* [activity](/microbit/lessons/night-light/activity) * [activity](/microbit/lessons/night-light/activity)
* [challenges](/microbit/lessons/night-light/challenges) * [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 ## Prior learning/place of lesson in scheme of work

View File

@ -16,9 +16,15 @@ If the rectangle above represents the BBC micro:bit, write the code to set all t
<br /> <br />
``` ```blocks
led.setBrightness(255) led.setBrightness(255)
led.plotAll() basic.showLeds(`
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
`)
``` ```
## 3. Consider the following image ## 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/> <br/>
``` ```blocks
led.setBrightness(128) led.setBrightness(128)
led.plotAll() basic.showLeds(`
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
`)
``` ```
## 4. Consider the following image ## 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. If the rectangle above represents the BBC micro:bit, write the code to turn off all the LEDs.
``` ```blocks
led.setBrightness(0) led.setBrightness(0)
``` ```

View File

@ -10,10 +10,8 @@ While Loop
* [activity](/microbit/lessons/rotation-animation/activity) * [activity](/microbit/lessons/rotation-animation/activity)
* [challenges](/microbit/lessons/rotation-animation/challenges) * [challenges](/microbit/lessons/rotation-animation/challenges)
* [quiz](/microbit/lessons/rotation-animation/quiz)
## Class * [quiz answers](/microbit/lessons/rotation-animation/quiz-answers)
Year 7
## Prior learning/place of lesson in scheme of work ## Prior learning/place of lesson in scheme of work
@ -38,17 +36,14 @@ while (true) {
basic.pause(20) basic.pause(20)
} }
``` ```
## Objectives ## 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 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 global variable * learn how to set or change the value of a variable
* learn how to repeat code while a condition is true * 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 run code when an input button is pressed
* learn how to show a series of image frames on the LED screen * 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 * learn how to pause your code for the specified number of milliseconds

View File

@ -54,9 +54,6 @@ Now let's add to this by creating a condition for on button pressed `A` before t
```blocks ```blocks
let rotating = true; let rotating = true;
input.onButtonPressed(Button.A, () => {
serial.writeLine("hello")
})
while (rotating) { while (rotating) {
serial.writeLine("loop") serial.writeLine("loop")
basic.showLeds(` 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 ```blocks
let rotating = true; let rotating = true;
input.onButtonPressed(Button.A, () => {
serial.writeLine("hello")
rotating = false
})
while (rotating) { while (rotating) {
serial.writeLine("loop") serial.writeLine("loop")
basic.showLeds(` basic.showLeds(`
@ -136,7 +130,10 @@ while (rotating) {
. . . . . . . . . .
`) `)
} }
input.onButtonPressed(Button.A, () => {
serial.writeLine("hello")
rotating = false
})
``` ```

View File

@ -12,6 +12,8 @@ If (Conditionals)
* [activity](/microbit/lessons/spinner/activity) * [activity](/microbit/lessons/spinner/activity)
* [challenges](/microbit/lessons/spinner/challenges) * [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 ## Prior learning/place of lesson in scheme of work

View File

@ -12,6 +12,8 @@ For Loop
* [activity](/microbit/lessons/strobe-light/activity) * [activity](/microbit/lessons/strobe-light/activity)
* [challenges](/microbit/lessons/strobe-light/challenges) * [challenges](/microbit/lessons/strobe-light/challenges)
* [quiz](/microbit/lessons/strobe-light/quiz)
* [quiz answers](/microbit/lessons/strobe-light/quiz-answers)
## Documentation ## Documentation

View File

@ -45,7 +45,14 @@ for (let i = 0; i < 5; i++) {
The pause will add a delay between lighting each LED. 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 ### ~avatar avatar

View File

@ -12,6 +12,8 @@ If (Conditionals)
* [activity](/microbit/lessons/truth-or-dare/activity) * [activity](/microbit/lessons/truth-or-dare/activity)
* [challenges](/microbit/lessons/truth-or-dare/challenges) * [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 ## Prior learning/place of lesson in scheme of work