move lessons out of web site
will move select lessons back to "educators" section
This commit is contained in:
37
olddocs/lessons/smiley/activity.md
Normal file
37
olddocs/lessons/smiley/activity.md
Normal 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)!
|
||||
|
||||
### ~
|
||||
|
93
olddocs/lessons/smiley/challenges.md
Normal file
93
olddocs/lessons/smiley/challenges.md
Normal 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.
|
||||
|
51
olddocs/lessons/smiley/quiz-answers.md
Normal file
51
olddocs/lessons/smiley/quiz-answers.md
Normal 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?
|
||||
|
||||

|
||||
|
||||
<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(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`)
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 4. Write the code to make this image
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
```
|
||||
|
||||

|
||||
|
54
olddocs/lessons/smiley/quiz.md
Normal file
54
olddocs/lessons/smiley/quiz.md
Normal 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?
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## 3. Draw the image created with this code
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`)
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 4. Draw the images created with this code
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
```
|
||||
|
||||

|
||||
|
Reference in New Issue
Block a user