pxt-calliope/olddocs/lessons/digi-yoyo.md

38 lines
1.0 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# digi yoyo lesson
2016-05-27 00:24:10 +02:00
Create a counter with a while loop.
2016-03-26 00:47:20 +01:00
## Topic
While Loop
## Quick Links
2016-04-13 17:27:45 +02:00
* [activity](/lessons/digi-yoyo/activity)
* [challenges](/lessons/digi-yoyo/challenges)
* [quiz](/lessons/digi-yoyo/quiz)
* [quiz answers](/lessons/digi-yoyo/quiz-answers)
2016-03-26 00:47:20 +01:00
## Prior learning/place of lesson in scheme of work
Learn how to creating a **while loop**, `while condition do` to repeat code while a condition is true. We will be learning how to create a digi yoyo app using a while loop, a variable, as well as basic commands, such as pause and show number.
## Documentation
2016-04-05 07:33:13 +02:00
```cards
2016-03-30 00:59:00 +02:00
let x = 0
basic.showNumber(0)
2016-04-05 07:33:13 +02:00
while (true) {}
basic.pause(20)
2016-03-30 00:59:00 +02:00
```
2016-03-26 00:47:20 +01:00
2016-03-30 00:59:00 +02:00
## Objectives
2016-03-26 00:47:20 +01:00
2016-03-30 00:59:00 +02:00
* learn how to create a local variables to store data and use it in your code
* learn how to set or change the value of a local variable
* learn how to repeat code while a condition is true
* learn how a relational comparison (<) of numbers will yield a Boolean
* learn how to pause your code for the specified number of milliseconds
* learn how to show a number on the LED screen
2016-03-26 00:47:20 +01:00