pxt-calliope/docs/lessons/seismograph.md

36 lines
952 B
Markdown
Raw Normal View History

2016-04-29 01:49:57 +02:00
# Seismograph Lesson
Build a seismograph with household materials
## Topic
Acceleration & Analog Read Pin
## Quick Links
* [activity](/lessons/seismograph/activity)
2016-05-12 17:48:10 +02:00
* [challenge](/lessons/seismograph/challenge)
2016-04-29 01:49:57 +02:00
## Prior learning/place of lesson in scheme of work
Learn how to **show LEDs** to turn on a LED light pattern on the LED screen. We will be learning basic comments such as show LEDs and pause.
## Documentation
```cards
basic.forever(() => {
2016-05-12 17:49:25 +02:00
radio.sendNumber(input.acceleration(Dimension.Strength) - 1023);
});
radio.onDataReceived(() => {
led.plotBarGraph(radio.receiveNumber(), 0);
2016-04-29 01:49:57 +02:00
});
```
## Objectives
* learn how to repeat code forever in the background
* learn how to display a vertical bar graph based on the value.
* learn how to return the sum of the two numbers
* learn how to get acceleration value in milli-gravitys
* learn how to read the connector value as analog as a value comprised between 0 and 1023