Countdown from 10
Published on October 2, 2021
In this tutorial, you will learn how to make a simple countdown. I will use 10 as an example - when the user pushes a button, the system has a label for the countdown. When the time is up, the label will say 'Time's up!'.
🏷️ Tags: #newbie, #tutorials-and-guides
Step 1. Importing Projects
Use the skill you have learnt about exporting and importing projects to import this project to MIT App Inventor. After importing, you can find the following components:
a Button
a Label and
a Clock. The clock in this app will act as a timer.
If you go to the Properties of Clock1, you see that TimerEnabled is unchecked. This is because the clock will only be enabled when the button is pushed. Also, you see the TimerInterval is 1000 (millisecond). 1000 milliseconds is 1 second.
Step 2. Blocks
If you go to Blocks, you will see some blocks are already programmed for you. You just need to complete a few.
Add this to the when Clock1. Timer event (right). When the Clock has counted 1000 milliseconds, if previous second is the last second, set the label's text to 'Time's up!', else set the label's text to the next second.
Test your app out
Now, go to your AI Companion on your phone and connect your phone with your computer. Test your app out now. Does it work?