Second edit pass. Needs better image examples?
This commit is contained in:
parent
7b74428275
commit
28d522175b
@ -7,8 +7,8 @@ to make real programs that work!
|
|||||||
|
|
||||||
### Show LEDs
|
### Show LEDs
|
||||||
|
|
||||||
Use the blocks below to draw something. You can draw another smiley
|
Draw something in the editor with this block. You can draw another
|
||||||
face, or try something else.
|
smiley face, or try something else.
|
||||||
|
|
||||||
```shuffle
|
```shuffle
|
||||||
basic.showLeds(`
|
basic.showLeds(`
|
||||||
@ -26,9 +26,9 @@ To move your program from your computer to the BBC micro:bit:
|
|||||||
* Drag and drop the new file whose name ends in **.hex** into the **MICROBIT** window.
|
* Drag and drop the new file whose name ends in **.hex** into the **MICROBIT** window.
|
||||||
* Wait until the yellow light stops blinking!
|
* Wait until the yellow light stops blinking!
|
||||||
|
|
||||||
### Show Animation Forever
|
### Show animation forever
|
||||||
|
|
||||||
Show one image after another by snapping blocks together to create an
|
Show one picture after another by snapping blocks together to create an
|
||||||
animation (like a cartoon)!
|
animation (like a cartoon)!
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
@ -60,7 +60,7 @@ Make an animation that never stops with the ``forever`` block.
|
|||||||
|
|
||||||
Unscramble these blocks in the editor to make an animation that first
|
Unscramble these blocks in the editor to make an animation that first
|
||||||
shows a happy face, then an unhappy face, then a happy face, and never
|
shows a happy face, then an unhappy face, then a happy face, and never
|
||||||
stops. You can also change the pictures to make your own animation.
|
stops.
|
||||||
|
|
||||||
```shuffle
|
```shuffle
|
||||||
basic.forever(() => {
|
basic.forever(() => {
|
||||||
@ -81,8 +81,9 @@ basic.forever(() => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Your turn now!
|
### Your turn!
|
||||||
|
|
||||||
|
You can also change the pictures to make your own animation.
|
||||||
Make your own awesome animation with the ``show leds`` and ``forever``
|
Make your own awesome animation with the ``show leds`` and ``forever``
|
||||||
blocks.
|
blocks.
|
||||||
|
|
||||||
@ -94,12 +95,8 @@ You can make your animation longer if you use more than two pictures.
|
|||||||
|
|
||||||
### Button A and B
|
### Button A and B
|
||||||
|
|
||||||
In the editor, unscramble the blocks below so that the micro:bit shows
|
This program will show the word `banana` on the LED
|
||||||
**YES** when you press button `A` and **NO** when when you press
|
screen when you press button `B`.
|
||||||
button `B`. All of the blocks under `on button A pressed` or `on
|
|
||||||
button B pressed` should run when you press that button. For example,
|
|
||||||
this program will show the word `banana` on the LED screen when you
|
|
||||||
press `B`.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
input.onButtonPressed(Button.B, () => {
|
input.onButtonPressed(Button.B, () => {
|
||||||
@ -107,7 +104,10 @@ input.onButtonPressed(Button.B, () => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Now try to unscramble these blocks in the editor:
|
Now try to unscramble these blocks in the editor so that the micro:bit
|
||||||
|
shows **YES** when you press button `A` and **NO** when when you press
|
||||||
|
button `B`. All of the blocks under `on button A pressed` or `on
|
||||||
|
button B pressed` should run when you press that button.
|
||||||
|
|
||||||
```shuffle
|
```shuffle
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
@ -120,12 +120,12 @@ input.onButtonPressed(Button.B, () => {
|
|||||||
|
|
||||||
### Shake
|
### Shake
|
||||||
|
|
||||||
You can find when someone is shaking the BBC micro:bit with the
|
You can find when someone is shaking the BBC micro:bit by checking its
|
||||||
**accelerometer** (it finds whether the micro:bit is speeding up or
|
**accelerometer** (it finds whether the micro:bit is speeding up or
|
||||||
slowing down).
|
slowing down).
|
||||||
|
|
||||||
Unscramble these blocks in the editor to show a frownie
|
Unscramble these blocks in the editor to show a frownie when someone
|
||||||
when someone shakes the micro:bit.
|
shakes the micro:bit.
|
||||||
|
|
||||||
```shuffle
|
```shuffle
|
||||||
input.onGesture(Gesture.Shake, () => {
|
input.onGesture(Gesture.Shake, () => {
|
||||||
@ -144,7 +144,7 @@ You can also find when someone is tilting the micro:bit left or right,
|
|||||||
face up or face down, and logo up or logo down (the logo is the yellow
|
face up or face down, and logo up or logo down (the logo is the yellow
|
||||||
oval picture at the top of the board).
|
oval picture at the top of the board).
|
||||||
|
|
||||||
Try to build a Rock Paper Scissors game where you turn the micro:bit
|
Try to build a Rock Paper Scissors game where you tilt the micro:bit
|
||||||
left to show paper, right to show scissors, and down to show rock.
|
left to show paper, right to show scissors, and down to show rock.
|
||||||
|
|
||||||
Unscramble these blocks in the editor and try this program on the
|
Unscramble these blocks in the editor and try this program on the
|
||||||
@ -179,11 +179,9 @@ input.onGesture(Gesture.TiltRight, () => {
|
|||||||
|
|
||||||
### Pins
|
### Pins
|
||||||
|
|
||||||
You can also use the pins as buttons.
|
You can also use the pins as buttons. (The pins are the holes in the
|
||||||
(The pins are the holes in the big metal bar at the bottom
|
metal bar at the bottom of the micro:bit board.) For example, hold
|
||||||
of the board.)
|
the ``GND`` button with one hand and touch the ``0`` pin (called
|
||||||
|
|
||||||
Hold the ``GND`` button with one hand and touch the ``0`` pin (called
|
|
||||||
``P0``) with your other hand to tell the micro:bit you're pressing it.
|
``P0``) with your other hand to tell the micro:bit you're pressing it.
|
||||||
|
|
||||||
Unscramble the blocks in the editor to show a smiley when you press
|
Unscramble the blocks in the editor to show a smiley when you press
|
||||||
@ -200,7 +198,7 @@ input.onPinPressed(TouchPin.P0, () => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Your turn now!
|
### Your turn!
|
||||||
|
|
||||||
Use the screen, buttons, gestures, and pins to make your own fun game
|
Use the screen, buttons, gestures, and pins to make your own fun game
|
||||||
with the BBC micro:bit!
|
with the BBC micro:bit!
|
||||||
|
Loading…
Reference in New Issue
Block a user