From 612142a292db0b1748a93204e81fd8eee70221dd Mon Sep 17 00:00:00 2001 From: Michael Elliot Braun Date: Wed, 30 Mar 2016 16:43:56 -0700 Subject: [PATCH 1/2] updated lessons --- docs/lessons.md | 4 ++-- docs/{reference/js => }/lessons/speed-button.md | 0 .../speed-button/activity.md} | 14 ++++++-------- .../js => }/lessons/speed-button/quiz-answers.md | 6 +++--- .../js => }/lessons/speed-button/quiz.md | 6 +++--- 5 files changed, 14 insertions(+), 16 deletions(-) rename docs/{reference/js => }/lessons/speed-button.md (100%) rename docs/{reference/js/lessons/speed-button/challenges.md => lessons/speed-button/activity.md} (94%) rename docs/{reference/js => }/lessons/speed-button/quiz-answers.md (97%) rename docs/{reference/js => }/lessons/speed-button/quiz.md (97%) diff --git a/docs/lessons.md b/docs/lessons.md index 55ba1f2a..7b84f312 100644 --- a/docs/lessons.md +++ b/docs/lessons.md @@ -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 ## 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 -* [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 diff --git a/docs/reference/js/lessons/speed-button.md b/docs/lessons/speed-button.md similarity index 100% rename from docs/reference/js/lessons/speed-button.md rename to docs/lessons/speed-button.md diff --git a/docs/reference/js/lessons/speed-button/challenges.md b/docs/lessons/speed-button/activity.md similarity index 94% rename from docs/reference/js/lessons/speed-button/challenges.md rename to docs/lessons/speed-button/activity.md index 1e8ffac0..8d87d6f5 100644 --- a/docs/reference/js/lessons/speed-button/challenges.md +++ b/docs/lessons/speed-button/activity.md @@ -6,11 +6,9 @@ Coding challenges for the speed button tutorial. #docs 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 fastPress = false 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. -``` +```blocks let counter1 = 0 let fastPress1 = false 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. -``` +```blocks let counter2 = 0 let fastPress2 = false 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. -``` +```blocks let counter3 = 0 let fastPress3 = false 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. -``` +```blocks let counter4 = 0 let fastPress4 = false input.onButtonPressed(Button.A, () => { diff --git a/docs/reference/js/lessons/speed-button/quiz-answers.md b/docs/lessons/speed-button/quiz-answers.md similarity index 97% rename from docs/reference/js/lessons/speed-button/quiz-answers.md rename to docs/lessons/speed-button/quiz-answers.md index cbcceb1d..acdf3765 100644 --- a/docs/reference/js/lessons/speed-button/quiz-answers.md +++ b/docs/lessons/speed-button/quiz-answers.md @@ -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. -``` +```blocks 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. -``` +```blocks let count_ = 0 input.onButtonPressed(Button.A, () => { 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. -``` +```blocks count_ = 0 input.onButtonPressed(Button.A, () => { count_ = count_ + 1 diff --git a/docs/reference/js/lessons/speed-button/quiz.md b/docs/lessons/speed-button/quiz.md similarity index 97% rename from docs/reference/js/lessons/speed-button/quiz.md rename to docs/lessons/speed-button/quiz.md index a1e0fcd0..51d303bc 100644 --- a/docs/reference/js/lessons/speed-button/quiz.md +++ b/docs/lessons/speed-button/quiz.md @@ -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 -``` +```blocks 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 -``` +```blocks let count_ = 0 input.onButtonPressed(Button.A, () => { 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. -``` +```blocks count_ = 0 input.onButtonPressed(Button.A, () => { count_ = count_ + 1 From 529b18e4231e908bdaf814fcb188ddabdc6a427a Mon Sep 17 00:00:00 2001 From: Michael Elliot Braun Date: Wed, 30 Mar 2016 16:44:41 -0700 Subject: [PATCH 2/2] updated lessons --- docs/lessons/ornament-chain.md | 21 ------- docs/lessons/ornament-chain/activity.md | 80 ------------------------- docs/lessons/speed-button.md | 2 +- 3 files changed, 1 insertion(+), 102 deletions(-) delete mode 100644 docs/lessons/ornament-chain.md delete mode 100644 docs/lessons/ornament-chain/activity.md diff --git a/docs/lessons/ornament-chain.md b/docs/lessons/ornament-chain.md deleted file mode 100644 index 20f3f416..00000000 --- a/docs/lessons/ornament-chain.md +++ /dev/null @@ -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 - diff --git a/docs/lessons/ornament-chain/activity.md b/docs/lessons/ornament-chain/activity.md deleted file mode 100644 index a67d78fd..00000000 --- a/docs/lessons/ornament-chain/activity.md +++ /dev/null @@ -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! diff --git a/docs/lessons/speed-button.md b/docs/lessons/speed-button.md index 63092092..750d78c6 100644 --- a/docs/lessons/speed-button.md +++ b/docs/lessons/speed-button.md @@ -10,7 +10,7 @@ Running Time ## Quick Links -* [tutorial](/microbit/lessons/speed-button/tutorial) +* [activity](/microbit/lessons/speed-button/activity) * [quiz](/microbit/lessons/speed-button/quiz) * [quiz answers](/microbit/lessons/speed-button/quiz-answers) * [challenges](/microbit/lessons/speed-button/challenges)