Migrate docs from the other repo
This commit is contained in:
32
docs/reference/js/lessons/glowing-pendulum/challenges.md
Normal file
32
docs/reference/js/lessons/glowing-pendulum/challenges.md
Normal file
@ -0,0 +1,32 @@
|
||||
# glowing pendulum challenges
|
||||
|
||||
Coding challenges for the glowing pendulum tutorial. #docs
|
||||
|
||||
## Before we get started
|
||||
|
||||
Complete the following guided tutorial:
|
||||
|
||||
* [tutorial](/microbit/lessons/glowing-pendulum/tutorial)
|
||||
|
||||
At the end of the tutorial, click `keep editing`. Your code should look like this:
|
||||
|
||||
```
|
||||
basic.forever(() => {
|
||||
let acceleration = input.acceleration("y")
|
||||
acceleration = math.abs(acceleration)
|
||||
acceleration = acceleration / 4
|
||||
led.setBrightness(acceleration)
|
||||
led.plotAll()
|
||||
})
|
||||
```
|
||||
|
||||
**Challenge 1**
|
||||
|
||||

|
||||
|
||||
Hold the BBC micro:bit in your hand in a dark room. Move the BBC micro:bit like a pendulum, and produce a slow image that captures the pattern of the BBC micro:bit LEDs.
|
||||
|
||||
**Challenge 2**
|
||||
|
||||
Replace "y" in `[input->acceleration("y")] with "x" or "z". Changing the axis will cause the BBC micro:bit to measure the force in a different direction. What differences in the resulting pattern does this replacement make?
|
||||
|
Reference in New Issue
Block a user