This commit is contained in:
Peli de Halleux 2016-03-30 17:10:09 -07:00
commit 24ce19654c
7 changed files with 15 additions and 118 deletions

View File

@ -59,9 +59,9 @@ Overview of lessons for the BBC micro:bit.
* [Telegraph](/microbit/lessons/telegraph), play the telegraph game between two BBC micro:bits * [Telegraph](/microbit/lessons/telegraph), play the telegraph game between two BBC micro:bits
## Advanced ## Advanced
* [Speed Button](/microbit/lessons/speed-button), code a speed game with running time
* [Hero](/microbit/lessons/hero), reconstruct the classic arcade game pac man with the BBC micro:bit * [Hero](/microbit/lessons/hero), reconstruct the classic arcade game pac man with the BBC micro:bit
* [Catch the Egg](/microbit/lessons/catch-the-egg-game), reconstruct the classic game of Catch the Egg with the BBC micro:bit * [Catch the Egg](/microbit/lessons/catch-the-egg-game), catch falling eggs in a basket with an acceleration controller
### ~ ### ~
### @section full ### @section full

View File

@ -1,21 +0,0 @@
# ornament chain lesson
display beautiful images on the BBC micro:bit #var #pause #docs
## Topic
Network devices
## Quick Links
* [activity](/microbit/lessons/ornament-chain/activity)
## Prior learning/place of lesson in scheme of work
Learn how to convert your BBC micro:bit into a telegraph using a second BBC micro:bit as well as pin P1, P2, 3V, GND, and crocodile clips (or spring clips). The connect BBC micro:bit uses pins P1, P2, 3V, GND.
## Objectives
* learn how to setup the BBC micro:bit with crocodile clips
* learn how to telegraph to another BBC micro:bit

View File

@ -1,80 +0,0 @@
# ornament chain activity
Build a telgraph
# micro:bit Ornament Chain
![](/static/mb/lessons/ornament-chain-0.jpg)
![](/static/mb/lessons/ornament-chain-1.jpg)
In this project, you will build your ornament chain between micro:bits. Project duration: 15 minutes.
## Materials
* micro:bit, battery holder and 2 AAA batteries
* Crocodile clips
## Steps
### Step 1
![](/static/mb/lessons/banana-keyboard-1.png)
Using the 1st crocodile clip, connect the end of the crocodile clip onto GND pin on the micro:bit.
### Step 2
![](/static/mb/lessons/ornament-chain-2.png)
Using the 2nd crocodile clip, connect the end of the crocodile clip onto the 3V pin on the micro:bit.
### Step 3
![](/static/mb/lessons/ornament-chain-3.png)
Using the 3rd crocodile clip, connect the end of the crocodile clip onto pin 1 of the micro:bit.
### Step 4
![](/static/mb/lessons/ornament-chain-4.png)
Using the 4th crocodile clip, connect the end of the crocodile clip onto pin 2 of the micro:bit.
### Step 5
![](/static/mb/lessons/ornament-chain-5.png)
Using the 1st crocodile clip, connect the unattached end of the crocodile clip onto the GND on the 2nd micro:bit.
### Step 6
![](/static/mb/lessons/ornament-chain-6.png)
Using the 2nd crocodile clip, connect the unattached end of the crocodile clip onto the 3V pin on the 2nd micro:bit.
### Step 7
![](/static/mb/lessons/ornament-chain-7.png)
Using the 3rd crocodile clip, connect the unattached end of the crocodile clip onto pin 2 of the 2nd micro:bit.
### Step 8
![](/static/mb/lessons/ornament-chain-8.png)
Using the 4th crocodile clip, connect the unattached end of the crocodile clip onto pin 1 of the 2nd micro:bit
### Step 9
![](/static/mb/lessons/ornament-chain-0.jpg)
![](/static/mb/lessons/ornament-chain-1.jpg)
Your ornament chain is ready!
### Step 10
* Connect the first micro:bit to your computer using your USB cable and run the [ornament chain](/microbit/fcicvk) script on it.
* Connect the second micro:bit to your computer using your USB cable and run the [ornament chain](/microbit/fcicvk) script on it.
* The first person and second person take turns pressing button A to start the ornament chain game!

View File

@ -10,7 +10,7 @@ Running Time
## Quick Links ## Quick Links
* [tutorial](/microbit/lessons/speed-button/tutorial) * [activity](/microbit/lessons/speed-button/activity)
* [quiz](/microbit/lessons/speed-button/quiz) * [quiz](/microbit/lessons/speed-button/quiz)
* [quiz answers](/microbit/lessons/speed-button/quiz-answers) * [quiz answers](/microbit/lessons/speed-button/quiz-answers)
* [challenges](/microbit/lessons/speed-button/challenges) * [challenges](/microbit/lessons/speed-button/challenges)

View File

@ -6,11 +6,9 @@ Coding challenges for the speed button tutorial. #docs
Complete the following guided tutorial: Complete the following guided tutorial:
* [tutorial](/microbit/lessons/speed-button/tutorial) Your starting code should look like this:
At the end of the tutorial, click `keep editing`. Your code should look like this: ```blocks
```
let counter = 0 let counter = 0
let fastPress = false let fastPress = false
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
@ -22,7 +20,7 @@ input.onButtonPressed(Button.A, () => {
We need to know when the user has hit button `A` 15 times. The user wins when he/she is able to accomplish this in less than 5000 milliseconds (5 seconds). We can check for both conditions by using an `and` operator. When using an `and` operator, both conditions need to be true in order for the condition to be true. We need to know when the user has hit button `A` 15 times. The user wins when he/she is able to accomplish this in less than 5000 milliseconds (5 seconds). We can check for both conditions by using an `and` operator. When using an `and` operator, both conditions need to be true in order for the condition to be true.
``` ```blocks
let counter1 = 0 let counter1 = 0
let fastPress1 = false let fastPress1 = false
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
@ -34,7 +32,7 @@ input.onButtonPressed(Button.A, () => {
Next, if the user has won, let's set our boolean to true. This indicates that he or she has won. Next, if the user has won, let's set our boolean to true. This indicates that he or she has won.
``` ```blocks
let counter2 = 0 let counter2 = 0
let fastPress2 = false let fastPress2 = false
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
@ -49,7 +47,7 @@ input.onButtonPressed(Button.A, () => {
We want to set `fastPress` to false if the user was too slow. To do so, we need another condition to see if the user took more than 5000 milliseconds (5 seconds). In the `if` statement, set `fastPress` to false. We want to set `fastPress` to false if the user was too slow. To do so, we need another condition to see if the user took more than 5000 milliseconds (5 seconds). In the `if` statement, set `fastPress` to false.
``` ```blocks
let counter3 = 0 let counter3 = 0
let fastPress3 = false let fastPress3 = false
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
@ -69,7 +67,7 @@ input.onButtonPressed(Button.A, () => {
Now let's display if the user won or lost. To do so, we need to check the status of `fastPress` when the game is finished, and then show the correct message. Now let's display if the user won or lost. To do so, we need to check the status of `fastPress` when the game is finished, and then show the correct message.
``` ```blocks
let counter4 = 0 let counter4 = 0
let fastPress4 = false let fastPress4 = false
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {

View File

@ -12,7 +12,7 @@ A variable that is available throughout your main function.
## 2. If the rectangle below represents the BBC micro:bit, shade the area that shows the value of the variable count. ## 2. If the rectangle below represents the BBC micro:bit, shade the area that shows the value of the variable count.
``` ```blocks
let count = 0 let count = 0
``` ```
@ -20,7 +20,7 @@ let count = 0
## 3. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded. ## 3. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded.
``` ```blocks
let count_ = 0 let count_ = 0
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
count_ = count_ + 1 count_ = count_ + 1
@ -36,7 +36,7 @@ After two button presses, **count** will be equal to 2.
## 5. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded. ## 5. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded.
``` ```blocks
count_ = 0 count_ = 0
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
count_ = count_ + 1 count_ = count_ + 1

View File

@ -14,7 +14,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 2. Draw which LEDs show the number being stored as a global variable called count ## 2. Draw which LEDs show the number being stored as a global variable called count
``` ```blocks
let count = 0 let count = 0
``` ```
@ -22,7 +22,7 @@ let count = 0
## 3. Draw which LED is ON after running this code and pressing Button A twice. Explain why you chose to draw that number ## 3. Draw which LED is ON after running this code and pressing Button A twice. Explain why you chose to draw that number
``` ```blocks
let count_ = 0 let count_ = 0
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
count_ = count_ + 1 count_ = count_ + 1
@ -36,7 +36,7 @@ input.onButtonPressed(Button.A, () => {
## 4. Draw which LED is ON after running this code and pressing Button A five times. Explain why you chose to draw that number. ## 4. Draw which LED is ON after running this code and pressing Button A five times. Explain why you chose to draw that number.
``` ```blocks
count_ = 0 count_ = 0
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
count_ = count_ + 1 count_ = count_ + 1