6. case 04:Timer¶
6.1. Our Goal¶
Use our watch kit to create a wearable timer.
1 x Watch kit
6.3. Hardware Connection¶
Assemble our watch kit directly just like the picture below.
When start our program, create a variable
flagand set its value to 0. When button A is pressed, delay time for 5 second. When button B is pressed, set the value of variable
foreverloop and place an if statement under it. When the variable
flagequals to 1, then activate the function.
Set time delay and play the built-in music
nyanfor once. Then set the variable
The watch can keep time precisely and play music.