@ -2,11 +2,11 @@
|
||||
|
||||
Rotate images with a while loop.
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Welcome! This tutorial will teach how to rotate images with a **while loop**. Let's get started!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
Let's start by creating a global variable called `rotating` and initialize it to true. This well indicate when the animation should be displaying.
|
||||
|
||||
@ -61,9 +61,9 @@ while (rotating) {
|
||||
}
|
||||
```
|
||||
|
||||
### ~avatar avatar
|
||||
## ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/rotation-animation/challenges)!
|
||||
|
||||
### ~
|
||||
## ~
|
||||
|
||||
|
@ -47,7 +47,7 @@ while (rotating) {
|
||||
```
|
||||
|
||||
|
||||
### Challenge 1
|
||||
## Challenge 1
|
||||
|
||||
Now let's add to this by creating a condition for on button pressed `A` before the while loop. We will also introduce serial writeLine for the while loop and input OnButtonPressed
|
||||
|
||||
@ -91,7 +91,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
```
|
||||
|
||||
### Challenge 2
|
||||
## Challenge 2
|
||||
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
* Run the code to see the awesome rotation.
|
||||
|
||||
### Challenge 3
|
||||
## Challenge 3
|
||||
|
||||
Let's also make the image rotate the opposite way when button A is pressed! We can do this with another while loop that is only executed while `not rotating`.
|
||||
|
||||
|
Reference in New Issue
Block a user