move lessons out of web site

will move select lessons back to "educators" section
This commit is contained in:
Tom Ball
2016-06-14 11:49:58 -04:00
parent a6e6dd8287
commit f4eca66648
184 changed files with 8 additions and 8 deletions

View File

@ -0,0 +1,37 @@
# smiley blocks activity
Learn to design a blinking image.
### ~avatar avatar
Welcome! This tutorial will help you make a smiley face blink. Let's get started!
### ~
Create an animation with an image displaying a smiley face and the next image with no LEDs lit up. This will make it look like the smiley face is blinking as the display switches between images.
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
```
### ~avatar boothing
Excellent, you're ready to continue with the [challenges](/lessons/smiley/challenges)!
### ~

View File

@ -0,0 +1,93 @@
# smiley blocks challenges
Coding challenges for the smiley.
## Before we get started
Complete the [smiley activity](/lessons/smiley/activity) and your code will look like this:
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
```
### Challenge 1
What if we want to make the face to frown on button pressed A?
Let's make add code that will run when button A is pressed!
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
input.onButtonPressed(Button.A, () => {
})
```
### Challenge 2
Now, we want to show a frowny face when this button is pressed. Let's show the LEDs.
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. # . # .
. # . # .
. . . . .
. # # # .
# . . . #
`)
})
```
* Run your code to see if it works as expected.
### Challenge 3
When *button B* is pressed, let's change the sad face back to a happy face. To do this, begin by adding a condition for `on button pressed` *B*. Next, show LEDs as a smiley face inside the condition.

View File

@ -0,0 +1,51 @@
# smiley blocks quiz answers
This is the answer key for the [smiley quiz](/lessons/smiley/quiz).
## 1. Describe what `show LEDs` does
A function that will display an image on the LED screen
## 2. Why is there an extra empty frame after the smiley face?
![](/static/mb/lessons/smiley-0.png)
<br/>
The extra empty image with show LED creates a blinking smiley, allowing the micro:bit to alternate between showing the smiley and the empty screen.
## 3. Draw the image created with this code
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
```
![](/static/mb/blocks/lessons/smiley-4.png)
## 4. Write the code to make this image
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
```
![](/static/mb/blocks/lessons/smiley-6.png)

View File

@ -0,0 +1,54 @@
# smiley blocks quiz
Make a smiley face blink
## Name
## Directions
Use the hints in the [Smiley](/lessons/smiley/activity) activity to answer this quiz!
## 1. Describe what `show LEDs` does
## 2. Why is there an extra empty frame after the smiley face?
![](/static/mb/lessons/smiley-0.png)
## 3. Draw the image created with this code
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
```
![](/static/mb/empty-microbit.png)
## 4. Draw the images created with this code
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
```
![](/static/mb/lessons/looper-3.png)