Compare commits

...

23 Commits

Author SHA1 Message Date
3b3a1140b4 0.0.17 2016-03-30 11:22:52 -07:00
085af70db3 Merge branch 'master' of https://github.com/Microsoft/kindscript-microbit 2016-03-30 11:15:41 -07:00
df8aaaca5a lesson updates 2016-03-30 11:15:31 -07:00
4d1f157ed3 0.0.16 2016-03-30 10:50:22 -07:00
0500da7a72 Bump kindscript to 0.1.123 2016-03-30 10:50:20 -07:00
0d321114c0 updated color 2016-03-30 10:46:40 -07:00
8f61570158 0.0.15 2016-03-29 23:09:21 -07:00
06916c4f82 Bump kindscript to 0.1.121 2016-03-29 23:09:19 -07:00
850c313c5d batch replace onButtonPressed(Button... 2016-03-29 21:17:57 -07:00
1f7e0b0f79 smoothly transition back to non-tilted 2016-03-29 21:14:27 -07:00
a0b3b77118 updated quizzes 2016-03-29 16:24:11 -07:00
8d1f59dc84 finished updated lessons 2016-03-29 16:17:34 -07:00
6a932a9c5c updated lessons 2016-03-29 16:16:31 -07:00
40405b7e7b updated lessons 2016-03-29 15:59:00 -07:00
0e816f2398 moved remaining quizzes 2016-03-29 15:21:17 -07:00
c6e2391bcd Merge branch 'master' of https://github.com/Microsoft/kindscript-microbit 2016-03-29 15:14:40 -07:00
00adabe441 file management quizzes 2016-03-29 15:14:16 -07:00
3ccec89f33 updated demo program 2016-03-29 14:19:56 -07:00
d5488a3ae8 0.0.14 2016-03-29 13:55:36 -07:00
8a14a95fcc Bump kindscript to 0.1.119 2016-03-29 13:55:34 -07:00
d0fcd5f400 0.0.13 2016-03-29 13:47:07 -07:00
d9c51b5fd5 docs update 2016-03-29 13:17:00 -07:00
8cbd8e5a74 quiz updates 2016-03-29 13:13:18 -07:00
140 changed files with 711 additions and 1931 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ tmp/
*.ts.new
*.tgz
temp/
*.db

View File

@ -36,6 +36,14 @@ input.onButtonPressed(Button.A, () => {
# . . . #
. # # # .`);
});
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .`);
});
input.onGesture(Gesture.Shake, () => {
basic.showLeds(`
. . . . .
@ -44,6 +52,7 @@ input.onGesture(Gesture.Shake, () => {
. # # # .
# . . . #`);
});
basic.showString("BBC micro:bit");
```
## C++ Runtime

View File

@ -52,7 +52,7 @@ The first job of the scheduler is to allow multiple *subprograms* to be queued u
```
export function countButtonPresses() {
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
})
basic.forever(() => {
@ -65,7 +65,7 @@ export function countButtonPresses() {
The program above contains three statements that execute in order from top to bottom. The first statement
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
})
```
@ -132,14 +132,14 @@ As a result, you can easily add a new capability to the micro:bit by just adding
```
export function countButtonPressesWithReset() {
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
})
basic.forever(() => {
basic.showNumber(count, 150)
})
count = 0
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
count = 0
})
}

View File

@ -15,9 +15,6 @@ Show String
* [quiz answers](/microbit/lessons/answering-machine/quiz-answers)
* [challenges](/microbit/lessons/answering-machine/challenges)
## Class
Year 7
## Prior learning / place of lesson in scheme of work
@ -25,7 +22,16 @@ Learn how to creating a message with a **string**, `show string` to write your m
## Documentation
* **show string** : [read more...](/microbit/reference/basic/show-string)
```docs
basic.showString('Hi!')
input.onButtonPressed(Button.A, () => {
})
```
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
## Objectives
@ -33,48 +39,3 @@ Learn how to creating a message with a **string**, `show string` to write your m
* learn how to show a string on the LED screen one character at a time
* learn how to use to register an event handler that will execute whenever an input button is pressed
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Uses criteria to evaluate the quality of solutions, can identify improvements making some refinements to the solution, and future solutions (EV)
* Evaluates the appropriatness of digital devices, internet services and application software to achieve given goals (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/answering-machine/activity)
* [quiz](/microbit/lessons/answering-machine/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/answering-machine/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/answering-machine/challenges)

View File

@ -32,5 +32,10 @@ basic.showString("Hi")
![](/static/mb/lessons/answering-machine-2.png)
![](/static/mb/blocks/lessons/answering-machine-5.png)
```blocks
basic.showString("Z")
```

View File

@ -10,10 +10,6 @@ Music
* [activity](/microbit/lessons/banana-keyboard/activity)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to convert your BBC micro:bit into a music player using pins P0 and GND, earphones (or speakers), as well as crocodile clips (or spring clips). The connect fruit using pins P1 and GND.

View File

@ -11,9 +11,6 @@ Music
* [activity](/microbit/lessons/beatbox/activity)
* [challenges](/microbit/lessons/beatbox/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
@ -23,40 +20,3 @@ Learn how to make a beatbox music player using pins P1 and P2. We will be learni
* learn how to code music on the BBC micro:bit
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/beatbox/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/beatbox/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/beatbox/challenges)

View File

@ -13,9 +13,6 @@ Show LEDs
* [activity](/microbit/lessons/beautiful-image/activity)
* [challenges](/microbit/lessons/beautiful-image/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
@ -23,50 +20,22 @@ Learn how to **show LEDs**, to show an image on the BBC micro:bit's LED screen.
## Documentation
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **pause** : [read more...](/microbit/reference/basic/pause)
```docs
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
basic.pause(100)
```
## Objectives
* learn how to display an image on the micro:bit's LED screen
* learn how to pause your code for the specified number of milliseconds
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Selects the appropriate data types(AL) (AB
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/beautiful-image/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/beautiful-image/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/beautiful-image/challenges)

View File

@ -15,36 +15,28 @@ Plot
* [quiz answers](/microbit/lessons/blink/quiz-answers)
* [challenges](/microbit/lessons/blink/challenges)
## Class
Year 7
## Prior learning / place of lesson in scheme of work
Learn how to control a blinking LED. We will be learning how to create a blinking app using forever as well as simple commands, such as plot, unplot and pause.
## What the teacher needs to know / QuickStart Computing Glossary
**Program:** A stored set of instructions encoded in a language understood by the computer that does some form of computation, processing input and/or stored data to generate output.
**Algorithm:** An unambiguous set of rules or a precise step-by-step guide to solve a problem or achieve a particular objective. The guided tutorial follows a algorithm and is a precise step-by-step guide to solve a problem
**Loop:** A block of code repeated automatically under the programs control. The blink program introduces Forever. The forever loop repeats code in the background forever.
**Command:** An instruction for the computer to execute, written in a particular programming language.
## Documentation
* **plot**: [read more...](/microbit/reference/led/plot)
* **unplot**: [read more...](/microbit/reference/led/unplot)
* **pause**: [read more...](/microbit/reference/basic/pause)
* **forever**: [read more...](/microbit/reference/basic/forever)
```docs
led.plot(0, 0)
## Resources
led.unplot(0, 0)
basic.pause(100)
basic.forever(() => {
})
```
* Activity: [activity](/microbit/lessons/blink/activity)
* Activity: [quiz](/microbit/lessons/blink/quiz)
* Extended Activity: [challenges](/microbit/lessons/blink/challenges)
## Objectives
@ -52,41 +44,3 @@ Learn how to control a blinking LED. We will be learning how to create a blinkin
* learn how to turn off LED lights on the LED screen
* learn how to pause program execution for the specified number of milliseconds
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/blink/activity)
* [quiz](/microbit/lessons/blink/quiz)
* [quiz answers](/microbit/lessons/blink/quiz-answers)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/blink/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/blink/challenges)

View File

@ -20,12 +20,24 @@ Learn the functions of **on data received**, **send number** and **receive numbe
## Documentation
* **forever** : [read more...](/microbit/reference/basic/forever)
* **acceleration** : [read more...](/microbit/reference/input/acceleration)
* **plot bar graph** : [read more...](/microbit/reference/led/plot-bar-graph)
* **on data received** : [read more...](/microbit/reference/radio/on-data-received)
* **send number** : [read more...](/microbit/reference/radio/send-number)
* **receive number** : [read more...](/microbit/reference/radio/receive-number)
```docs
basic.showNumber(0)
input.acceleration(Dimension.X)
led.plotBarGraph(0, 1023)
radio.onDataReceived(() => {
})
radio.sendNumber(0)
radio.receiveNumber()
```
## Objectives
@ -35,24 +47,3 @@ Learn the functions of **on data received**, **send number** and **receive numbe
* learn how to register code to run when a packet is received over radio
* learn how to broadcast a number data packet to other micro:bits connected via radio
* learn how to read the next radio packet as a number data packet
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Uses a variable and relational operators within a loop to govern termination (AL) (GE)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/charting/activity)

View File

@ -13,9 +13,6 @@ If (Conditionals)
* [activity](/microbit/lessons/compass/activity)
* [challenges](/microbit/lessons/compass/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
@ -23,14 +20,25 @@ Learn how to use an if statements to run code run code depending on whether a co
## Documentation
* **Compass Heading** : [read more...](/microbit/reference/input/compass-heading)
* **Forever** : [read more...](/microbit/reference/basic/forever)
* **Variables** : [read more...](/microbit/reference/variables/var)
* **Assignment Operator** : [read more...](/microbit/reference/variables/assign)
* **If** : [read more...](/microbit/reference/logic/if)
* **Comparison Operator** : [read more...](/microbit/reference/types/number)
* **Show String** : [read more...](/microbit/reference/basic/show-string)
* **Show LEDs** : [read more...](/microbit/reference/basic/show-leds)
```docs
input.compassHeading()
basic.forever(() => {})
let x = 0
if (true) {}
basic.showString("Hello!")
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
@ -41,57 +49,3 @@ Learn how to use an if statements to run code run code depending on whether a co
* learn how to return a random number
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show an image on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Uses filters or can perform single criteria searches for information.(AL)
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
* Defines data types: real numbers and Boolean (AB)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Makes judgements about digital content when evaluating and repurposing it for a given audience (EV) (GE)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/compass/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/compass/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/compass/challenges)

View File

@ -14,41 +14,36 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
Gets the compass heading of the micro:bit in degrees
<br/>
## 2. Write the code that stores the compass heading into a local variable called 'degrees'.
<br/>
```
```blocks
let degrees = input.compassHeading()
```
## 3. Write the 'If statement' that will check if the device is mostly pointing North. Display 'N' on the micro:bit
<br />
```
```blocks
if (degrees < 45) {
basic.showString("N", 150)
}
```
## 3. Write the 'If statement' that will check if the device is mostly pointing East. Display 'E' on the micro:bit
## 4. Write the 'If statement' that will check if the device is mostly pointing East. Display 'E' on the micro:bit
<br />
```
```blocks
if (degrees < 135) {
basic.showString("E", 150)
}
```
## 3. Write the 'If statement' that will check if the device is mostly pointing South. Display 'S' on the micro:bit
## 5. Write the 'If statement' that will check if the device is mostly pointing South. Display 'S' on the micro:bit
<br />
```
```blocks
if (degrees < 225) {
basic.showString("S", 150)
}

View File

@ -12,21 +12,15 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. What is the purpose of the 'compass heading' block?
<br/>
## 2. Write the code that stores the compass heading into a local variable called 'degrees'.
<br/>
## 3. Write the 'If statement' that will check if the device is mostly pointing North. Display 'N' on the micro:bit
<br />
## 3. Write the 'If statement' that will check if the device is mostly pointing East. Display 'E' on the micro:bit
## 4. Write the 'If statement' that will check if the device is mostly pointing East. Display 'E' on the micro:bit
<br />
## 3. Write the 'If statement' that will check if the device is mostly pointing South. Display 'S' on the micro:bit
## 5. Write the 'If statement' that will check if the device is mostly pointing South. Display 'S' on the micro:bit
<br />

View File

@ -13,16 +13,38 @@ Variables
* [activity](/microbit/lessons/counter/activity)
* [challenges](/microbit/lessons/counter/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to creating a **variable** to keep track of the current count. We will be learning how to create a counter app using a variable as well as simple commands, such as on button pressed, and show number.
## Documentation
```docs
input.compassHeading()
basic.forever(() => {
})
let x = 0
if (true) {
}
basic.showString("Hello!")
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
* **variable**: [read more...](/microbit/reference/variables/var)
* **arithmetic operators**: [read more...](/microbit/reference/types/number)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
@ -35,41 +57,3 @@ Learn how to creating a **variable** to keep track of the current count. We will
* learn how to run code when an input button is pressed
* learn how to show a number on the LED screen, one digit at a time (scrolling from left to right)
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Declares and assigns variables.(AB)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/counter/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/counter/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/counter/challenges)

View File

@ -10,7 +10,7 @@ Answers may vary but a variable is a place where you can store and retrieve data
## 2. Draw the stored value for the variable called count
```
```blocks
let count = 0
```
@ -22,9 +22,9 @@ We create a **variable**, `count` to keep track of the current count. The number
## 3. Draw which LEDs are ON after running this code and pressing button "A" once. Explain you chose to draw that number
```
```blocks
let count_ = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count_ = count_ + 1
basic.showNumber(count, 150)
})
@ -38,9 +38,9 @@ We are only pressing on button pressed once. So the number to display on the mic
## 4. Draw which LEDs are ON after running this code and pressing button "A" three times. Explain you chose to draw that number
```
```blocks
count_ = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count_ = count_ + 1
basic.showNumber(count_, 100)
})

View File

@ -16,7 +16,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 2. Draw the stored value for the variable called count
```
```blocks
let count = 0
```
@ -26,9 +26,9 @@ let count = 0
## 3. Draw which LEDs are ON after running this code and pressing button "A" once. Explain you chose to draw that number
```
```blocks
let count_ = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count_ = count_ + 1
basic.showNumber(count_, 100)
})
@ -40,9 +40,9 @@ input.onButtonPressed("A", () => {
## 4. Draw which LEDs are ON after running this code and pressing button "A" three times. Explain you chose to draw that number
```
```blocks
count_ = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count_ = count_ + 1
basic.showNumber(count_, 100)
})

View File

@ -13,9 +13,6 @@ If (Conditionals)
* [activity](/microbit/lessons/die-roll/activity)
* [challenges](/microbit/lessons/die-roll/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
@ -23,12 +20,33 @@ Learn how to use an if statements to run code run code depending on whether a co
## Documentation
* **Variables** : [read more...](/microbit/reference/variables/var)
* **If** : [read more...](/microbit/blocks/if)
* **On Shake** : [read more...](/microbit/reference/on-gesture)
* **Assignment Operator** : [read more...](/microbit/reference/variables/assign)
* **Pick Random** : [read more...](/microbit/blocks/math)
* **Show LEDs** : [read more...](/microbit/reference/basic/show-leds)
```docs
input.onGesture(Gesture.Shake, () => {
})
let x = 0
x = Math.random(3)
if (true) {
}
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
@ -39,57 +57,3 @@ Learn how to use an if statements to run code run code depending on whether a co
* learn how to return a random number
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show an image on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Uses filters or can perform single criteria searches for information.(AL)
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
* Defines data types: real numbers and Boolean (AB)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Makes judgements about digital content when evaluating and repurposing it for a given audience (EV) (GE)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/die-roll/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/die-roll/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/die-roll/challenges)

View File

@ -13,22 +13,28 @@ While Loop
* [activity](/microbit/lessons/digi-yoyo/activity)
* [challenges](/microbit/lessons/digi-yoyo/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to creating a **while loop**, `while condition do` to repeat code while a condition is true. We will be learning how to create a digi yoyo app using a while loop, a variable, as well as basic commands, such as pause and show number.
## Documentation
* **variables** : [read more...](/microbit/reference/variables/var)
* **assignment operator** : [read more...](/microbit/reference/variables/assign)
* **while loop** : [read more...](/microbit/reference/loops/while)
* **relational operator ** : [read more...](/microbit/reference/types/number)
* **pause** : [read more...](/microbit/reference/basic/pause)
* **show number** : [read more...](/microbit/reference/basic/show-number)
```docs
let x = 0
basic.showNumber(0)
while (true) {
basic.pause(20)
}
```
## Objectives
@ -39,50 +45,3 @@ Learn how to creating a **while loop**, `while condition do` to repeat code whil
* learn how to pause your code for the specified number of milliseconds
* learn how to show a number on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Recognises that different solutions exist for the same problem (AL) (AB) Understands that iteration is the repetition of a process such as a loop (AL)
* Recognises that different algorithms exist for the same problem (AL) (GE)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Uses a variable and relational operators within a loop to govern termination (AL) (GE)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Uses filters or can perform single criteria searches for information.(AL)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/digi-yoyo/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/digi-yoyo/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/digi-yoyo/challenges)

View File

@ -14,21 +14,32 @@ Pause
* [quiz](/microbit/lessons/flashing-heart/quiz)
* [quiz answers](/microbit/lessons/flashing-heart/quiz-answers)
* [challenges](/microbit/lessons/flashing-heart/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to `show LEDs` by showing an image on the LED screen. We will be learning how to create a blinking app using a forever loop as well as simple commands, such as show LEDs, pause, and clear screen.
## Documentation
* **forever**: [read more...](/microbit/reference/basic/forever)
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **pause**: [read more...](/microbit/reference/basic/pause)
* **clear screen**: [read more...](/microbit/reference/basic/clear-screen)
```docs
basic.forever(() => {
})
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
basic.pause(100)
basic.clearScreen()
```
## Objectives
@ -36,43 +47,3 @@ Learn how to `show LEDs` by showing an image on the LED screen. We will be learn
* learn how to show LEDs on the LED screen
* learn how to pause your code for the specified number of milliseconds
* learn how to turn off all the LED lights on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Declares and assigns variables.(AB)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Exercise
* time: 20 min.
* [activity](/microbit/lessons/flashing-heart/activity)
* [quiz](/microbit/lessons/flashing-heart/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/flashing-heart/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/flashing-heart/challenges)

View File

@ -13,61 +13,25 @@ Game Library
* [activity](/microbit/lessons/game-counter/activity)
* [challenges](/microbit/lessons/game-counter/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to create game blocks to keep track of the current score. We will be learning how to create a game using the blocks called `add points to score`, `score` as well as simple commands such as on button pressed and show number.
## Documentation
* **game library**: [read more...](/microbit/js/game-library)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
* **show number** : [read more...](/microbit/reference/basic/show-number)
```docs
game.addScore(1)
input.onButtonPressed(Button.A, () => {
})
basic.showNumber(0)
```
## Objectives
* learn how arithmetic operators operate on numbers and return a number
* learn how to run code when an input button is pressed
* learn how to show a score on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Declares and assigns variables.(AB)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/game-counter/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/game-counter/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/game-counter/challenges)

View File

@ -11,67 +11,26 @@ Game Library
* [activity](/microbit/lessons/game-of-chance/activity)
* [challenges](/microbit/lessons/game-of-chance/challenges)
## Class
Year 7
## Prior learning / place of lesson in scheme of work
Learn how to creating a message with a **game over** to write your message. We will be learning how to create a message using show string and on button pressed.
## Documentation
* **game library** : [read more...](/microbit/js/game-library)
* **show string** : [read more...](/microbit/reference/basic/show-string)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
```docs
game.gameOver()
basic.showString("Hello!")
input.onButtonPressed(Button.A, () => {
})
```
## Objectives
* learn how to use the game library
* learn how to show a string on the LED screen one character at a time
* learn how to use to register an event handler that will execute whenever an input button is pressed
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Uses criteria to evaluate the quality of solutions, can identify improvements making some refinements to the solution, and future solutions (EV)
* Evaluates the appropriatness of digital devices, internet services and application software to achieve given goals (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/game-of-chance/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/game-of-chance/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/game-of-chance/challenges)

View File

@ -21,12 +21,30 @@ Learn how to get the acceleration **acceleration**, `acceleration` value (g-forc
## Documentation
* **forever** : [read more...](/microbit/reference/basic/forever)
* **local variable** : [read more...](/microbit/reference/variables/var)
* **acceleration** : [read more...](/microbit/reference/input/acceleration)
* **absolute value** : [read more...](/microbit/js/math)
* **set brightness** : [read more...](/microbit/reference/led/set-brightness)
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
```docs
basic.forever(() => {
})
let x = 0
input.acceleration(Dimension.X)
Math.abs(0)
led.setBrightness(255)
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
@ -37,49 +55,3 @@ Learn how to get the acceleration **acceleration**, `acceleration` value (g-forc
* learn how to sets the brightness of the LED screen
* learn how to turn on all the LED lights on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Uses a variable and relational operators within a loop to govern termination (AL) (GE)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Uses filters or can perform single criteria searches for information.(AL)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/glowing-pendulum/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/glowing-pendulum/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/glowing-pendulum/challenges)

View File

@ -20,7 +20,7 @@ We are creating a forever loop to constantly display the appropriate brightness
<br/>
```
```blocks
let acceleration = input.acceleration("y")
```
@ -28,16 +28,16 @@ let acceleration = input.acceleration("y")
<br/>
```
acceleration = math.abs(acceleration)
```blocks
let acceleration = math.abs(acceleration)
```
## 4. Write the code that uses the acceleration value from question #3 to set the brightness on the BBC micro:bit.
<br/>
```
acceleration = acceleration / 4
```blocks
let acceleration = acceleration / 4
led.setBrightness(acceleration)
```

View File

@ -15,24 +15,10 @@ Fade Out
* [quiz answers](/microbit/lessons/glowing-sword/quiz-answers)
* [challenges](/microbit/lessons/glowing-sword/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to manipulate an image through **fade out**, `fade out` to gradually decrease the LED screen brightness until the LED lights are turned off. We will be learning how to fade an image using simple commands, such as image create image, image show image, LED fade out, basic pause, and fade in.
## What the teacher needs to know/QuickStart Computing Glossary
* Algorithm: An unambiguous set of rules or a precise step-bystep guide to solve a problem or achieve a particular objective.
* Computational thinking: Thinking about systems or problems in a way that allows computer systems to be used to model or solve these.
* Hardware: The physical systems and components of digital devices; see also software.
* Programmable toys: Robots designed for children to use, accepting input, storing short sequences of simple instructions and moving according to this stored program.
* Script: A computer program typically executed one line at a time through an interpreter, such as the instructions for a Scratch character.
* Sequence: To place program instructions in order, with each executed one after the other.
* Simulation: Using a computer to model the state and behaviour of real-world (or imaginary) systems, including physical or social systems; an integral part of most computer games.
## Documentation
* **create image** : [read more...](/microbit/reference/images/create-image)
@ -41,57 +27,4 @@ Learn how to manipulate an image through **fade out**, `fade out` to gradually d
* **pause** : [read more...](/microbit/reference/basic/pause)
* **fade in** : [read more...](/microbit/reference/led/fade-in)
## Resources
* Activity: [activity](/microbit/lessons/glowing-sword/activity)
* Activity: [quiz](/microbit/lessons/glowing-sword/quiz)
* Extended Activity: [challenges](/microbit/lessons/glowing-sword/challenges)
## Objectives
* learn how to plot an image
* learn how to gradually decrease the LED screen brightness until the LED lights are turned off
* pause your code for the specified number of milliseconds
* learn how to gradually increase the LED screen brightness until the LED lights are turned on
## Links to the National Curriculum Programmes of Study for Computing
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/glowing-sword/activity)
* [quiz](/microbit/lessons/lucky-7/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/glowing-sword/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/glowing-sword/challenges)
## Intended follow on
Publish script to the classroom.

View File

@ -13,22 +13,29 @@ Math - Pick Random
* [activity](/microbit/lessons/guess-the-number/activity)
* [challenges](/microbit/lessons/guess-the-number/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to create numbers randomly by using the input of the BBC micro:bit. We will be learning how to create random numbers with input using a local variable as well as simple commands, such as pick number and show number.
## Documentation
* **on button pressed**: [read more...](/microbit/reference/input/on-button-pressed)
* **local variable **: [read more...](/microbit/reference/variables/var)
* **assignment operator**: [read more...](/microbit/reference/variables/assign)
* **show number**: [read more...](/microbit/reference/basic/show-number)
* **pick number**: [read more...](/microbit/blocks/math)
* **clear screen**: [read more...](/microbit/reference/basic/clear-screen)
```docs
input.onButtonPressed(Button.A, () => {
})
let x = 0
basic.showNumber(0)
Math.random(3)
basic.clearScreen()
```
## Objectives
@ -38,42 +45,3 @@ Learn how to create numbers randomly by using the input of the BBC micro:bit. We
* learn how to returns a random number
* learn how to show a number on the LED screen, one digit at a time (scrolling left to right)
* learn how to turn off all the LED lights on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Declares and assigns variables.(AB)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/guess-the-number/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/guess-the-number/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/guess-the-number/challenges)

View File

@ -12,26 +12,28 @@ Answers may vary. Generally, on button pressed run code when an input button is
Write the line of code that creates a condition when the BBC micro:bit button A is pressed.
```
input.onButtonPressed("A", () => {
```blocks
input.onButtonPressed(Button.A, () => {
})
```
## 3. Consider the following directions
## 3. Write the line of code that creates a **local variable** and a **random number**.
Write the line of code that creates a **local variable** and a **random number**.
```
```blocks
let randomNumber = Math.random(10)
```
## 4. Consider the following code
## 4.
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)
```
If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
![](/static/mb/lessons/guess-the-number-0.png)

View File

@ -24,7 +24,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 4. Draw the area that could be lit based on the code below. Explain why you chose to draw that number.
```
```blocks
let randomNumber = Math.random(10)
basic.showNumber(randomNumber, 150)
```

View File

@ -11,10 +11,6 @@ Music
* [activity](/microbit/lessons/happy-birthday/activity)
* [challenges](/microbit/lessons/happy-birthday/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to convert your BBC micro:bit into a music player using pins P0 and GND, earphones (or speakers), as well as crocodile clips (or spring clips). We will be learning how to code musical notes using simple commands such as play, keys, and notes.
@ -26,50 +22,7 @@ Learn how to convert your BBC micro:bit into a music player using pins P0 and GN
* Program: A stored set of instructions encoded in a language understood by the computer that does some form of computation, processing input and/or stored data to generate output.
* Simulation: Using a computer to model the state and behaviour of real-world (or imaginary) systems, including physical or social systems; an integral part of most computer games.
## Resources
* Activity: [activity](/microbit/lessons/happy-birthday/activity)
* Extended Activity: [challenges](/microbit/lessons/happy-birthday/challenges)
## Objectives
* learn how to code music on the BBC micro:bit
* learn how to setup the BBC micro:bit as a music player
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/happy-birthday/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/happy-birthday/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/happy-birthday/challenges)

View File

@ -10,10 +10,6 @@ Music
* [activity](/microbit/lessons/light-beatbox/activity)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to make a light beatbox music player using the light sensor. We will be learning how to code musical notes using light level, a local variable, conditionals, on button pressed as well as simple commands such as ring tone and rest.
@ -23,17 +19,3 @@ Learn how to make a light beatbox music player using the light sensor. We will b
* learn how to control the light sensor on the BBC micro:bit
* learn how to code music on the BBC micro:bit
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation

View File

@ -23,10 +23,15 @@ Learn how to control a blinking LED. We will be learning how to create a blinkin
## Documentation
* **for**: [read more...](/microbit/reference/loops/for)
* **show number**: [read more...](/microbit/reference/basic/show-number)
* **pause**: [read more...](/microbit/reference/basic/pause)
* **arithmetic operators**: [read more...](/microbit/reference/types/number)
```docs
for (let i = 0; i < 5; i++) {
}
basic.showNumber(0)
basic.pause(100)
```
## Objectives
@ -34,44 +39,3 @@ Learn how to control a blinking LED. We will be learning how to create a blinkin
* learn how to show a number on the LED screen, one digit at a time (scrolling from left to right)
* learn how to pause program execution for the specified number of milliseconds
* learn how to arithmetic operators operate on numbers and return a number
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses logical reasoning to predict outputs, showing an awareness of inputs. (AL)
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Uses a variable and relational operators within a loop to govern termination. (AL) (GE)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 10 min.
* [activity](/microbit/lessons/looper/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/looper/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/looper/challenges)

View File

@ -15,103 +15,26 @@ On Pin Pressed
* [quiz answers](/microbit/lessons/love-meter/quiz-answers)
* [challenges](/microbit/lessons/love-meter/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to use the **pin pressed**, `on pin pressed` to run code when the user holds the GND pin with one hand, and presses pin 0 with the other hand, thus completing a circuit. We will be learning how to create a love meter using input on pin pressed, a local variable, math random, If (conditional) as well as simple commands, such as show number, pause, and show string.
## What the teacher needs to know/QuickStart Computing Glossary
* Hardware: The physical systems and components of digital devices; see also software.
* Input: Data provided to a computer system, such as via a keyboard, mouse, microphone, camera or physical sensors.
* Output: The information produced by a computer system for its user, typically on a screen, through speakers or on a printer, but possibly through the control of motors in physical systems.
* Programmable toys: Robots designed for children to use, accepting input, storing short sequences of simple instructions and moving according to this stored program.
* Script: A computer program typically executed one line at a time through an interpreter, such as the instructions for a Scratch character.
* Variables: A way in which computer programs can store, retrieve or change data, such as a score, the time left, or the users name.
## Documentation
* **on pin pressed** : [read more...](/microbit/reference/input/on-pin-pressed)
* **local variable** : [read more...](/microbit/reference/variables/var)
* **Boolean** : [read more...](/microbit/reference/types/boolean)
* **math random** : [read more...](/microbit/js/math)
* **show number** : [read more...](/microbit/reference/basic/show-number)
* **pause** : [read more...](/microbit/reference/basic/pause)
* **If** : [read more...](/microbit/reference/logic/if)
* **show string** : [read more...](/microbit/reference/basic/show-string)
```docs
if (true) {
## Resources
}
* Activity: [activity](/microbit/lessons/love-meter/activity)
* Activity: [quiz](/microbit/lessons/love-meter/quiz)
* Extended Activity: [challenges](/microbit/lessons/love-meter/challenges)
input.onPinPressed(TouchPin.P0, () => {
## Objectives
})
let x = 0
Math.random(3)
basic.showNumber(0)
basic.pause(100)
* learn how to run code when the user holds the GND pin in one hand, and presses pin 0 with the other hand, thus completing a circuit; when you run a script with this function in a web browser, click pin 0 on the simulator
* learn how to a create a variable for a place where you can store and retrieve data
* learn how Boolean operators take Boolean inputs and evaluates to a Boolean output
* learn how to return a random number
* learn how to show a number on the LED screen
* learn how to pause your code for the specified number of milliseconds
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show a string on the LED screen one character at a time (scrolling from left to right)
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a variable and relational operators within a loop to govern termination (AL) (GE)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Uses filters or can perform single criteria searches for information.(AL)
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
* Defines data types: real numbers and Boolean (AB)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Makes judgements about digital content when evaluating and repurposing it for a given audience (EV) (GE)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/love-meter/activity)
* [quiz](/microbit/lessons/love-meter/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/love-meter/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/love-meter/challenges)
```

View File

@ -22,23 +22,25 @@ input.onPinPressed(TouchPin.P0, () => {
## 3. What does this line of code doing?
![](/static/mb/blocks/lessons/love-meter-6.png)
```blocks
let x = Math.random(9)
```
<br/>
It stores random number between 0 and 9 then stores that number in a variable.
## 4. Why do you have to add 1 to variable x?
![](/static/mb/blocks/lessons/love-meter-7.png)
<br/>
```blocks
let item = 0;
item = 0;
basic.showNumber(item + 1);
```
You have to add 1 if you want to generate a random number between 1 and 10 .
## 5. Why do you have to hold ground (GND) to make this work on the micro:bit?
<br/>
You have told GND to complete the circuit.

View File

@ -18,13 +18,20 @@ Answer the questions below while completing the activity. Pay attention to the d
## 3. Describe what this line of code does?
![](/static/mb/blocks/lessons/love-meter-6.png)
```blocks
let x = Math.random(9)
```
## 4. Describe what adding 1 to variable x does?
![](/static/mb/blocks/lessons/love-meter-7.png)
```blocks
let item = 0;
item = 0;
basic.showNumber(item + 1);
```
## 5. Describe why you must hold ground (GND) before pressing (P0) to run a program using `on pin pressed(P0)` on the micro:bit

View File

@ -15,79 +15,8 @@ Show Number
* [quiz answers](/microbit/lessons/lucky-7/quiz-answers)
* [challenges](/microbit/lessons/lucky-7/challenges)
## Class
Year 7
## Prior learning / place of lesson in scheme of work
Learn how to display a number, `show number` to generate numbers. We will be learning how to create numbers using show number as well as simple commands, such as pause.
## What the teacher needs to know / QuickStart Computing Glossary
* Programmable toys: Robots designed for children to use, accepting input, storing short sequences of simple instructions and moving according to this stored program.
* Simulation: Using a computer to model the state and behaviour of real-world (or imaginary) systems, including physical or social systems; an integral part of most computer games.
## Documentation
* **show number** : [read more...](/microbit/reference/basic/show-number)
* **pause** : [read more...](/microbit/reference/basic/pause)
## Resources
* Activity: [activity](/microbit/lessons/lucky-7/activity)
* Activity: [quiz](/microbit/lessons/lucky-7/quiz)
* Extended Activity: [challenges](/microbit/lessons/lucky-7/challenges)
## Objectives
* learn how to show a number on the LED screen, one digit at a time
* learn how to pause program execution for the specified number of milliseconds
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Understands that iteration is the repetition of a process such as a loop (AL)
* Recognises that different algorithms exist for the same problem (AL) (GE)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Defines data types: real numbers and Boolean (AB)
#### Hardware & Processing
* Understands the difference between hardware and application software, and their roles within a computer system (AB)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/lucky-7/activity)
* [quiz](/microbit/lessons/lucky-7/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/lucky-7/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/lucky-7/challenges)

View File

@ -11,23 +11,25 @@ If (Conditionals)
* [activity](/microbit/lessons/magic-8/activity)
* [challenges](/microbit/lessons/magic-8/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to creating **conditionals**, `if condition do` to conditionally run code depending on whether a condition is true or not. We will be learning how to create a fortune telling app using local variable and conditionals (If), input on shake as well as simple commands, such as show string, show number, and clear screen.
## Documentation
* **show string** : [read more...](/microbit/reference/basic/show-string)
* **show number** : [read more...](/microbit/reference/basic/show-number)
* **on shake** : [read more...](/microbit/reference/input/on-gesture)
* **clear screen** : [read more...](/microbit/reference/basic/clear-screen)
* **variable** : [read more...](/microbit/reference/variables/var)
* **pick number** : [read more...](/microbit/blocks/math)
* **if** : [read more...](/microbit/reference/logic/if)
```docs
if (true) {
}
Math.random(3)
input.onGesture(Gesture.Shake, () => {
})
basic.showNumber(7)
basic.clearScreen()
basic.showString("Hello!")
```
## Objectives
@ -39,57 +41,3 @@ Learn how to creating **conditionals**, `if condition do` to conditionally run c
* learn how to learn how to return a random number
* learn how to learn how to conditionally run code depending on whether a condition is true or not
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses diagrams to express solutions.(AB)
* Recognises that different solutions exist for the same problem (AL) (AB) Understands that iteration is the repetition of a process such as a loop (AL)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a variable and relational operators within a loop to govern termination (AL) (GE)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
* Defines data types: real numbers and Boolean (AB)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/magic-8/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/magic-8/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/magic-8/challenges)

View File

@ -13,19 +13,28 @@ On Logo Up
* [activity](/microbit/lessons/magic-logo/activity)
* [challenges](/microbit/lessons/magic-logo/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to plot image **on logo up**, `on logo up` to run code when the micro:bit screen is facing up and vertically orientated. We will be learning how to plot an image with the logo up, basic show LEDs, and logo down.
## Documentation
```docs
input.onLogoUp(() => {
* **on logo up** : [read more...](/microbit/functions/on-logo-up)
* **show leds** : [read more...](/microbit/reference/basic/show-leds)
* **on logo down** : [read more...](/microbit/functions/on-logo-down)
})
input.onLogoDown(() => {
})
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
@ -33,43 +42,3 @@ Learn how to plot image **on logo up**, `on logo up` to run code when the micro:
* learn how to run code when the micro:bit screen is facing down and vertically orientated
* learn how to run code when the micro:bit screen is facing up and vertically orientated
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Recognises the audience when designing and creating digital content (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/magic-logo/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/magic-logo/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/magic-logo/challenges)

View File

@ -13,19 +13,26 @@ Set Brightness
* [activity](/microbit/lessons/night-light/activity)
* [challenges](/microbit/lessons/night-light/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to **set brightness** of an image `set brightness` to set the brightness of the LED screen. We will be learning how to set the brightness of the LED screen using LED show LEDs, on button pressed and set brightness.
## Documentation
* **set brightness** : [read more...](/microbit/reference/led/set-brightness)
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
```docs
led.setBrightness(255)
input.onButtonPressed(Button.A, () => {
})
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
@ -33,39 +40,3 @@ Learn how to **set brightness** of an image `set brightness` to set the brightne
* learn how to run code when an input button is pressed
* learn how to turn on all LEDs
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Recognises that different algorithms exist for the same problem (AL) (GE)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/night-light/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/night-light/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/night-light/challenges)

View File

@ -23,10 +23,20 @@ Learn how to create a **local variable**, `var t :=time` where you can store dat
## Documentation
* **on shake** : [read more...](/microbit/reference/input/on-gesture)
* **local variable** : [read more...](/microbit/reference/variables/var)
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **pick random** : [read more...](/microbit/blocks/math)
```docs
input.onGesture(Gesture.Shake, () => {
})
Math.random(3)
let x = 0
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives

View File

@ -21,13 +21,27 @@ Learn how to create images that look like a rotating animation by using a while
## Documentation
* **variable**: [read more...](/microbit/reference/variables/var)
* **assignment operator**: [read more...](/microbit/reference/variables/assign)
* **while**: [read more...](/microbit/js/while)
* **Boolean condition (for the while loop)** : [read more...](/microbit/reference/types/boolean)
* **on button pressed**: [read more...](/microbit/reference/input/on-button-pressed)
* **show LEDs**: [read more...](/microbit/reference/basic/show-leds)
* **pause**: [read more...](/microbit/reference/basic/pause)
```docs
let x = 0
input.onButtonPressed(Button.A, () => {
})
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
basic.pause(100)
while (true) {
basic.pause(20)
}
```
## Objectives
@ -39,41 +53,3 @@ Learn how to create images that look like a rotating animation by using a while
* 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
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Declares and assigns variables.(AB)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/rotation-animation/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/rotation-animation/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/rotation-animation/challenges)

View File

@ -15,86 +15,31 @@ Clear Screen
* [quiz answers](/microbit/lessons/screen-wipe/quiz-answers)
* [challenges](/microbit/lessons/screen-wipe/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to **clear screen**, `clear screen` to turn off all the LED lights on the LED screen. We will be learning how to clear all LED lights on the LED screen using clear screen, input on button pressed as well as simple commands, such as show animation.
## What the teacher needs to know/QuickStart Computing Glossary
* Algorithm: An unambiguous set of rules or a precise step-by-step guide to solve a problem or achieve a particular objective.
* Hardware: The physical systems and components of digital devices; see also software.
* Input: Data provided to a computer system, such as via a keyboard, mouse, microphone, camera or physical sensors.
* Output: The information produced by a computer system for its user, typically on a screen, through speakers or on a printer, but possibly through the control of motors in physical systems.
* Programmable toys: Robots designed for children to use, accepting input, storing short sequences of simple instructions and moving according to this stored program.
* Simulation: Using a computer to model the state and behaviour of real-world (or imaginary) systems, including physical or social systems; an integral part of most computer games.
## Documentation
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
* **clear screen** : [read more...](/microbit/reference/basic/clear-screen)
```docs
basic.clearScreen()
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
input.onButtonPressed(Button.A, () => {
})
## Resources
* Activity: [activity](/microbit/lessons/screen-wipe/activity)
* Activity: [quiz](/microbit/lessons/screen-wipe/quiz)
* Extended Activity: [challenges](/microbit/lessons/screen-wipe/challenges)
```
## Objectives
* learn how to show a series of images on the LED screen
* learn how to run code when an input button is pressed
* learn how to turn off all the LED lights on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Shows an awareness of tasks best completed by humans or computers (EV)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Recognises that different solutions exist for the same problem (AL) (AB) Understands that iteration is the repetition of a process such as a loop (AL)
* Recognises that different algorithms exist for the same problem (AL) (GE)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Recognises ethical issues surrounding the application of information technology beyond school.
* Designs criteria to critically evaluate the quality of solutions, uses the criteria to identify improvements and can make appropriate refinements to the solution (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/screen-wipe/activity)
* [quiz](/microbit/lessons/screen-wipe/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/screen-wipe/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/screen-wipe/challenges)

View File

@ -15,11 +15,7 @@ Show LEDs
* [quiz answers](/microbit/lessons/smiley/quiz-answers)
* [challenges](/microbit/lessons/smiley/challenges)
## Class
Year 7
## Prior learning / place of lesson in scheme of work
## Prior learning/place of lesson in scheme of work
Learn how to **show LEDs** to turn on a LED light pattern on the LED screen. We will be learning basic comments such as show LEDs and pause.
@ -28,57 +24,22 @@ Learn how to **show LEDs** to turn on a LED light pattern on the LED screen. We
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
```docs
input.onButtonPressed(Button.A, () => {
})
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
* learn how to show LEDs on the LED screen
* learn how to run code when an input button is pressed
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Recognises that different algorithms exist for the same problem (AL) (GE)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
#### Hardware & Processing
* Understands the difference between hardware and application software, and their roles within a computer system (AB)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/smiley/activity)
* [quiz](/microbit/lessons/smiley/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/smiley/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/smiley/challenges)

View File

@ -15,76 +15,27 @@ Forever
* [quiz answers](/microbit/lessons/snowflake-fall/quiz-answers)
* [challenges](/microbit/lessons/snowflake-fall/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to show LEDs with a, `pause` to pause program execution for a specified amount of milliseconds. We will be learning how to show images using forever loop as well as simple commands, such as pause and show LEDs.
## What the teacher needs to know/QuickStart Computing Glossary
* Algorithm: An unambiguous set of rules or a precise step-bystep guide to solve a problem or achieve a particular objective.
* Command: An instruction for the computer to execute, written in a particular programming language.
* Hardware: The physical systems and components of digital devices; see also software.
* Programmable toys: Robots designed for children to use, accepting input, storing short sequences of simple instructions and moving according to this stored program.
* Program: A stored set of instructions encoded in a language understood by the computer that does some form of computation, processing input and/or stored data to generate output.
* Simulation: Using a computer to model the state and behaviour of real-world (or imaginary) systems, including physical or social systems; an integral part of most computer games.
## Documentation
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **pause** : [read more...](/microbit/reference/basic/pause)
* **forever** : [read more...](/microbit/reference/basic/forever)
## Resources
* Activity: [activity](/microbit/lessons/snowflake-fall/activity)
* Activity: [quiz](/microbit/lessons/snowflake-fall/quiz)
* Extended Activity: [challenges](/microbit/lessons/snowflake-fall/challenges)
## Objectives
* learn how to show an image on the LED screen
* learn how to pause a program for a specified amount of time in milliseconds
* learn how to repeat code in the background forever
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses diagrams to express solutions.(AB)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/snowflake-fall/activity)
* [quiz](/microbit/lessons/snowflake-fall/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/snowflake-fall/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/snowflake-fall/challenges)
```docs
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
basic.pause(100)
basic.forever(() => {
})
```

View File

@ -13,22 +13,30 @@ If (Conditionals)
* [activity](/microbit/lessons/spinner/activity)
* [challenges](/microbit/lessons/spinner/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to use an if statement to run code run code depending on whether a condition is true or not. We will be learning how to create a die with If statements, On Shake, Variables, Assignment Operator, Pick Random and Show LEDs.
## Documentation
* **If** : [read more...](/microbit/blocks/if)
* **Variables** : [read more...](/microbit/reference/variables/var)
* **Assignment Operator** : [read more...](/microbit/reference/variables/assign)
* **On Shake** : [read more...](/microbit/reference/input/on-gesture)
* **Pick Random** : [read more...](/microbit/blocks/math)
* **Show LEDs** : [read more...](/microbit/reference/basic/show-leds)
```docs
if (true) {
}
let x = 0
input.onGesture(Gesture.Shake, () => {
})
Math.random(3)
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
```
## Objectives
@ -40,54 +48,3 @@ Learn how to use an if statement to run code run code depending on whether a con
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show an image on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Uses filters or can perform single criteria searches for information.(AL)
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
* Defines data types: real numbers and Boolean (AB)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Makes judgements about digital content when evaluating and repurposing it for a given audience (EV) (GE)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/spinner/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/spinner/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/spinner/challenges)

View File

@ -13,16 +13,17 @@ For Loop
* [activity](/microbit/lessons/strobe-light/activity)
* [challenges](/microbit/lessons/strobe-light/challenges)
## Class
Year 7
## Documentation
* **For Loop**: [read more...](/microbit/reference/loops/for)
* **Plot**: [read more...](/microbit/reference/led/plot)
* **Unplot**: [read more...](/microbit/reference/led/unplot)
* **Pause**: [read more...](/microbit/reference/basic/pause)
```docs
led.plot(0, 0)
led.unplot(0, 0)
for (let i = 0; i < 5; i++) {
}
basic.pause(100)
```
## Objectives
@ -30,44 +31,3 @@ Year 7
* learn how to turn on a LED light on the LED screen. Specify with LED using x, y coordinates
* learn how to turn off a LED light on the LED screen. Specify which LED which x, y coordinates
* learn how to pause program execution for the specified number of milliseconds
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses logical reasoning to predict outputs, showing an awareness of inputs. (AL)
* Understands that iteration is the repetition of a process such as a loop. (AL)
* Represents solutions using a structured notation. (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals. (AL)
* Uses a variable and relational operators within a loop to govern termination. (AL) (GE)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
#### Data & Data Representation
* Understands the difference between data and information. (AB)
* Defines data types: real numbers and Boolean. (AB)
#### Information Technology
* Collects, organises and presents data and information in digital content. (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution. (EV)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 10 min.
* [activity](/microbit/lessons/strobe-light/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/strobe-light/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/strobe-light/challenges)

View File

@ -11,67 +11,25 @@ Temperature
* [activity](/microbit/lessons/temperature/activity)
* [challenges](/microbit/lessons/temperature/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to get the ambient temperature (degree Celsius °C). The temperature is inferred from the the surface temperature of the various chips on the micro:bit. We will be learning how to get the temperature using on shake, local variables, as well as simple commands such as show number.
## Documentation
* **on shake** : [read more...](/microbit/reference/input/on-gesture)
* **local variable** : [read more...](/microbit/reference/variables/var)
* **temperature** : [read more...](/microbit/reference/input/temperature)
* **show number** : [read more...](/microbit/reference/basic/show-number)
* **show string** : [read more...](/microbit/reference/basic/show-string)
```docs
input.temperature()
let x = 0
basic.showNumber(7)
basic.showString("Hello!")
input.onGesture(Gesture.Shake, () => {
})
```
## Objectives
* learn how to create a variable to store data
* learn how to get the ambient temperature (degree Celsius °C). The temperature is inferred from the the surface temperature of the various chips on the micro:bit.
* learn how to show a number on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Recognises that different algorithms exist for the same problem (AL) (GE)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Selects the appropriate data types(AL) (AB
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/temperature/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/temperature/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/temperature/challenges)

View File

@ -12,9 +12,7 @@ The Watch
* [activity](/microbit/lessons/the-watch/activity)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
@ -23,9 +21,3 @@ Learn how to design the BBC micro:bit watch with household supplies.
## Objectives
* learn how to design and make the watch with the BBC micro:bit
## Activity
* time: 20 min.
* [activity](/microbit/lessons/the-watch/activity)

View File

@ -13,23 +13,31 @@ If (Conditionals)
* [activity](/microbit/lessons/truth-or-dare/activity)
* [challenges](/microbit/lessons/truth-or-dare/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to use an if statement to run code run code depending on whether a condition is true or not. We will be learning how to create the game truth or dare using input an if statement, a local variable, math random as well as simple commands, such as show string and show LEDs.
## Documentation
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
* **local variable** : [read more...](/microbit/reference/variables/var)
* **assignment operator** : [read more...](/microbit/reference/variables/assign)
* **pick random** : [read more...](/microbit/blocks/math)
* **If** : [read more...](/microbit/blocks/if)
* **show string** : [read more...](/microbit/reference/basic/show-string)
```docs
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
input.onButtonPressed(Button.A, () => {
})
let x = 0
Math.random(3)
if (true) {
}
basic.showString("Hello!")
```
## Objectives
@ -40,42 +48,3 @@ Learn how to use an if statement to run code run code depending on whether a con
* learn how to return a random number
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show a string on the LED screen one character at a time (scrolling from left to right)
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses diagrams to express solutions.(AB)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Designs solutions by decomposing a problem and creates a sub-solution for each of these parts. (DE) (AL) (AB)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/truth-or-dare/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/truth-or-dare/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/truth-or-dare/challenges)

View File

@ -13,22 +13,24 @@ Acceleration
* [activity](/microbit/lessons/zoomer/activity)
* [challenges](/microbit/lessons/zoomer/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to get the **acceleration**, `acceleration` in one of three specified dimensions. We will be learning how to get the acceleration using a forever loop, local variables, input on button pressed, as well as simple commands, such as show number and pause.
## Documentation
* **forever** : [read more...](/microbit/reference/basic/forever)
* **local variable** : [read more...](/microbit/reference/variables/var)
* **acceleration** : [read more...](/microbit/reference/input/acceleration)
* **if** : [read more...](/microbit/reference/logic/if)
* **button is pressed** : [read more...](/microbit/reference/input/button-is-pressed)
* **show number** : [read more...](/microbit/reference/basic/show-number)
```docs
basic.forever(() => {
})
let x = 0
input.acceleration(Dimension.X)
if (true) {
}
input.buttonIsPressed(Button.A)
basic.showNumber(0)
```
## Objectives
@ -40,45 +42,3 @@ Learn how to get the **acceleration**, `acceleration` in one of three specified
* learn how to get the state of an input button
* learn how to show a number on the LED screen
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Represents solutions using a structured notation (AL) (AB)
* Can identify similarities and differences in situations and can use these to solve problems (pattern recognition)(GE)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a variable and relational operators within a loop to govern termination (AL) (GE)
#### Communication Networks
* Demonstrates responsible use of technologies and online services, and knows a range of ways to report concerns Understands how search engines rank search results (AL)
#### Information Technology
* Collects, organizes, and presents data and information in digital content (AB)
* Makes appropriate improvements to solutions based on feedback received, and can comment on the success of the solution (EV)
* Recognises ethical issues surrounding the application of information technology beyond school.
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [activity](/microbit/lessons/zoomer/activity)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/zoomer/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/zoomer/challenges)

View File

@ -37,7 +37,7 @@ let num = 0
basic.forever(() => {
basic.showNumber(num, 150)
})
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
num = num + 1
})
```

View File

@ -101,13 +101,13 @@ for (let i3 = 0; i3 < 5; i3++) {
Local scope allows you to use the same variable name in different parts of a program without concern about interference (as with variables with global scope). Here's the Touch Develop program that implements the "X" program without interference:
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
for (let i4 = 0; i4 < 5; i4++) {
led.plot(i4, i4)
basic.pause(1000)
}
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
for (let i5 = 0; i5 < 5; i5++) {
led.plot(4 - i5, i5)
basic.pause(1000)

View File

@ -19,7 +19,7 @@ control.inBackground(() => {
basic.pause(100)
}
})
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
num++;
})
```
@ -31,7 +31,7 @@ let num = 0
basic.forever(() => {
basic.showNumber(num, 150)
})
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
num++;
})
```
@ -44,7 +44,7 @@ If you have multiple processes that each show something on the LED screen, you m
basic.forever(() => {
basic.showNumber(6789, 150)
})
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showNumber(2, 150)
})
```

View File

@ -15,7 +15,7 @@ The code below shows a simple game where the user gets to press the button ``A``
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -27,7 +27,7 @@ let img = images.createImage(`
. . . . .
`)
img.showImage(0)
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
img.clear()
img.showImage(0)
})

View File

@ -13,7 +13,7 @@ The game library supports simple single-player time-based games. The player has
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -15,7 +15,7 @@ The code below shows a simple game where the user gets to press the button ``A``
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -13,7 +13,7 @@ The game library supports simple single-player time-based games. The general goa
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -98,10 +98,10 @@ This program will record the current acceleration measured on `x` when you press
```
let accelerations = (<number[]>[])
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
accelerations.push(input.acceleration("x"))
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
for (let i1 = 0; i1 < accelerations.length; i1++) {
basic.showString(accelerations[i1].toString(), 150)
}

View File

@ -9,7 +9,7 @@ An event handler is code that is associated with a particular event, such as "bu
Functions named "on <event>" create an association between an event and the event handler code. For example, the following code registers the event handler (the code between the `do` and `end` keywords) with the event of a press of button A:
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
```
@ -21,7 +21,7 @@ After this code executes, then whenever button A is pressed in the future, the s
Once you have registered an event handler for an event, like above, that event handler is active for the rest of the program execution. If you want to stop the string "hello" from printing each time button A is pressed then you need to arrange for the following code to execute:
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
})
```
@ -32,10 +32,10 @@ The above code associated an event handler that does nothing with the event of a
The above example also illustrates that there is only one event handler for each event. What is the result of the following code?
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("goodbye", 150)
})
```
@ -43,7 +43,7 @@ input.onButtonPressed("A", () => {
The answer is that whenever button A is pressed, the string "goodbye" will be printed. If you want both the strings "hello" and "goodbye" to be printed, you need to write the code like this:
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
basic.showString("goodbye", 150)
})

View File

@ -9,7 +9,7 @@ The game library supports simple single-player time-based games. The player has
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -15,7 +15,7 @@ The code below shows a simple game where the user gets to press the button ``A``
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -15,7 +15,7 @@ The code below shows a simple game where the user gets to press the button ``A``
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -15,7 +15,7 @@ The code below shows a simple game where the user gets to press the button ``A``
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -13,7 +13,7 @@ The game library supports simple single-player time-based games. The general goa
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -32,7 +32,7 @@ claimBall = true
<br/>
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
if (claimBall) {
pins.digitalWritePin("P0", 1)
}

View File

@ -9,7 +9,7 @@ Welcome! This [guided tutorial](https://live.microbit.co.uk/td/lessons/speed-but
```
counter = 0
fastPress = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
})
```
@ -21,7 +21,7 @@ We need to know when the user has hit button `A` 15 times. The user wins when he
```
counter = 0
fastPress = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 15 && input.runningTime() < 3500) {
}
@ -33,7 +33,7 @@ Next, if the user has won, let's set our boolean to true. This indicates that he
```
counter = 0
fastPress = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 15 && input.runningTime() < 3500) {
fastPress = true // ***
@ -48,7 +48,7 @@ We want to set `fastPress` to false if the user was too slow. To do so, we need
```
counter = 0
fastPress = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 15 && input.runningTime() < 3500) {
fastPress = true
@ -66,7 +66,7 @@ Now let's display if the user won or lost. To do so, we need to check the status
```
counter = 0
fastPress = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 15 && input.runningTime() < 3500) {
fastPress = true

View File

@ -12,7 +12,7 @@ At the end of the tutorial, click `keep editing`. Your code should look like thi
```
newAction() // ***
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
if (action == 0) {
game.addScore(1) // ***
newAction() // ***
@ -30,7 +30,7 @@ input.onGesture(Gesture.Shake, () => {
newAction() // ***
}
}) // ***
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
basic.showNumber(game.score(), 150) // ***
basic.pause(2000) // ***
newAction() // ***
@ -68,12 +68,12 @@ Now let's implement `PRESS PIN 0` in the main. Create a condition of `input->on
```
// **. . .**
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
basic.showNumber(game.score(), 150) // ***
basic.pause(2000) // ***
newAction() // ***
}) // ***
input.onPinPressed("P0", () => {
input.onPinPressed(TouchPin.P0, () => {
if (action == 3) {
game.addScore(1) // ***
newAction() // ***

View File

@ -33,7 +33,7 @@ if (action == 0) {
<br />
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
if (action == 0) {
game.addScore(1)
}

View File

@ -9,7 +9,7 @@ Welcome! This [guided tutorial](/microbit/lessons/break/tutorial) will assist yo
```
count = 0
shouldBreak = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
shouldBreak = true
})
while (true) {
@ -49,7 +49,7 @@ while (true) {
basic.showNumber(count, 150)
basic.pause(1000)
}
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
}) // ***
```
@ -57,7 +57,7 @@ Next, set `shouldBreak` back to false to indicate we want to run the `while` loo
```
// **. . .**
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
shouldBreak = false // ***
})
```
@ -66,7 +66,7 @@ And now copy the code from the previous while loop into the condition of `input-
```
// **. . .**
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
shouldBreak = false
while (true) {
if (shouldBreak) {

View File

@ -9,14 +9,14 @@ Howdy! This [guided tutorial](/microbit/rxqgzy) will help you complete this acti
In this guide, you will learn how to use buttons and show text on the screen. Let's start by adding to respond **when the left button is pressed**.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
})
```
All the code inside `input->on button pressed` runs when the button is pressed. Let's add the code to show some text.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
```
@ -26,10 +26,10 @@ input.onButtonPressed("A", () => {
Let's add an event handler for Button `B`.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
})
```
@ -38,10 +38,10 @@ input.onButtonPressed("B", () => {
Display `bye` when the `B` button is pressed.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
basic.showString("bye", 150)
})
```

View File

@ -18,7 +18,7 @@ basic.showAnimation(`
. . . . . # # # # # # # # # # # # # # #
. . . . . . . . . . . . . . . # # # # #
`, 400)
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.clearScreen()
})
```
@ -37,10 +37,10 @@ basic.showAnimation(`
. . . . . # # # # # # # # # # # # # # #
. . . . . . . . . . . . . . . # # # # #
`, 400)
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.clearScreen()
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
})
```
@ -56,10 +56,10 @@ basic.showAnimation(`
. . . . . # # # # # # # # # # # # # # #
. . . . . . . . . . . . . . . # # # # #
`, 400)
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.clearScreen()
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
basic.showAnimation(`
# # # # # # # # # # . . . . . . . . . .
# # # # # # # # # # . . . . . . . . . .

View File

@ -8,7 +8,7 @@ Welcome! This [guided tutorial](/microbit/lessons/comparison/tutorial) will assi
```
counter = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 10) {
counter = 1
@ -23,7 +23,7 @@ Now let's do something special when the micro:bit reaches the number `5`. Instea
```
counter = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 10) {
counter = 1
@ -40,7 +40,7 @@ Let's continue our plan of displaying `HALF WAY!` when `counter = 5`. To do so,
```
counter = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 10) {
counter = 1
@ -60,7 +60,7 @@ You may notice a problem right now. When `counter = 5`, the micro:bit will show
```
counter = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
counter = counter + 1
if (counter == 10) {
counter = 1

View File

@ -22,7 +22,7 @@ The code under ``on button pressed("A")`` will run each time the user presses A.
```
let count_ = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
})
```
@ -31,7 +31,7 @@ Since the count has changed, it's time to refresh the screen display. Let's add
```
let count_1 = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
basic.showNumber(count, 150)
})

View File

@ -8,7 +8,7 @@ Complete the following [guided tutorial](/microbit/lessons/counter/activity) At
```
let count = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
basic.showNumber(count, 150)
})
@ -22,11 +22,11 @@ Let's add the code to `count` when `B` is pressed. Add an event handler with `in
```
let count1 = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count1 = count1 + 1
basic.showNumber(count1, 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
count1 = count1 - 1 // ***
basic.showNumber(count1, 150) // ***
}) // ***

View File

@ -15,14 +15,14 @@ To create a new script, go to the [Create Code](/microbit/create-code) page and
Add an event handler when button `A` is pressed.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
})
```
Create a local variable of type number `x` and set it to a random number using `math->random`. `math->random(10)` generates a random number between `0` and `10` **excluded**.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
let x = Math.random(10)
})
```
@ -30,7 +30,7 @@ input.onButtonPressed("A", () => {
Show the random number on the screen.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
let x1 = Math.random(10)
basic.showNumber(x1, 150)
})

View File

@ -11,7 +11,7 @@ Complete the following guided tutorial:
At the end of the tutorial, click `keep editing`. Your code should look like this:
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
let x = Math.random(10)
basic.showNumber(x, 150)
})
@ -24,11 +24,11 @@ input.onButtonPressed("A", () => {
When button `B` is pressed, we want to clear the screen. This will make it so users can play your game over and over again! Add an event handler to handle this case.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
let x1 = Math.random(10)
basic.showNumber(x1, 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
basic.clearScreen() // ***
})
```

View File

@ -13,7 +13,7 @@ At the end of the tutorial, click `keep editing`. Your code should look like thi
```
count = 0
shouldBreak = false
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
shouldBreak = true
})
while (true) {
@ -60,7 +60,7 @@ while (true) {
basic.showNumber(count, 150)
basic.pause(1000)
}
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
}) // ***
```
@ -68,7 +68,7 @@ Next, set `should break` back to false to indicate we want to run the `while` lo
```
// **. . .**
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
shouldBreak = false // ***
})
```
@ -77,7 +77,7 @@ And now copy the code from the previous while loop into the condition of `input-
```
// **. . .**
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
shouldBreak = false
while (true) {
if (shouldBreak) {

Some files were not shown because too many files have changed in this diff Show More