From the course: Arduino: Prototyping

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Solution: Game intro

Solution: Game intro - Arduino Tutorial

From the course: Arduino: Prototyping

Solution: Game intro

(upbeat music) - [Instructor] Here's my solution to the challenge. Remember, the goal for this challenge is to display a welcome message and wait for a button press before continuing. The pseudocode for this is straightforward. To wait, you can use a while loop to check to see if the button is pressed. To make the while condition, we can use the currentReading variable, which is either high or low depending on whether the button is pressed or not. The while loop updates currentReading using the debounce function. Now let's go to the Desktop to see how this works in practice. Here we are in the IDE. And I've loaded Retro 6, which is our starting point. And the first thing I'm going to do is save a new copy. Call it RETRO_6_Challenge. Now we want to add our startup screen in the setup function. So we can do that here. So we can say display introduction. And I'll start out by clearing the screen. Then I'll…

Contents