stopwatch.jpg



Goal: Get the stop clock to work.



As one of our last apps, we want you to have the experience of following instructions you find online.

Phase 1

1. Try watching this video from beginning to end.

Now try to reproduce the logic of what you saw without having to follow the precise instructions. Remember, simply copying is discouraged.

2. App Inventor makes it easy to reuse code. A file has been created that you can use as a starting point. Here is the template file to get you started. Stopwatch_Template.aia

A) After clicking on the file, the file likely gets stored in the "Downloads" directory. From App Inventor, under the "Projects" tab, simply select import project (aia) from my computer and navigate to the Downloads directory.


3. Program the stop clock as shown in the video.





Phase 2. Using this code as a starting point, rework it as a count down timer.



1. Make a copy of your project (Projects/Save Project As...).

A) Call it TimesUp.

2. Make a timer which counts down from 30 seconds. When thirty seconds is reached, sound a buzzer.

A) Here is a buzzer you can use: AlarmAudio. You can use either a player or the sound media component. The sound component is usually better for shorter files or if you want both the player and sound file to play simultaneously.

3. Use a player to start a ticking sound. Here a ticking clock sound you can use:Ticker.

*** Remember to download the file, first click on the link and then right click on the player to select save audio as.


4. Allow the user to select the number of seconds desired.

***Notice that App Inventor allows you to use a text field as a number. If you restrict the field to be numeric, there can be no chance for input errors. If you want 100 seconds, that is allowed.

A) You may want to change the display to show it as 1:40:0.



5. Test your app.



Challenges

1. When the Start button is pressed, have the device slowly say "Mark, Get set, Go" before the stopwatch begins.