#How to Code a 10 Minute Timer
![10 min timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/8_6ae74ef8-db0b-400e-8f11-d693120c9b3c.png?v=1685698972)
By following this #How to guide, you will obtain a "10 minute timer" that is portable, adjustable, and can be placed anywhere.
10 Minute Timer Materials Needed:
1. CyberPi Go Kit (or mBot2)
2. Computer/Smartphone/Tablet with our mBlock software installed
![10 min timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/9_75cf9434-6e25-4171-942c-bf613ba7535b.png?v=1685699183)
CyberPi is an educational single-board computer that integrates various sensors and features, enabling programming and creative practices. You can use the display and buttons on CyberPi and the programming capability of CyberPi to code a 10 minute timer.
Let's start!
![10-minute timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/10-minute.gif?v=1685699285)
Download "mBlock" and connect CyberPi to your computer via a USB cable (or connect it to your phone or tablet via Bluetooth).
# Introduction #
10 Minute Timer Function Design Idea:
1. Press button A to start the countdown.
2. Reset the 10 min timer, like setting a new starting point for the countdown.
3. CyberPi repeatedly displays the time code (the time should be in integers) until the time reaches zero (the timer counts down from a set duration).
4. CyberPi emits a sound when the time is up.
5. The time code loops back to the initial state before you press button A.
![mBot Neo with Coding Project Box: Easier, Faster, and More Fun Coding Learning](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/12_637e12de-1d03-4205-bb3e-1c10b36ae7d6.png?v=1685700237)
![10 min timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/10_a53c1dc1-95a5-4529-aeb0-f39483d017dc.png?v=1685700930)
![10 min timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/11_ab7b940d-827a-40ba-bafa-70eb85a79eac.png?v=1685699971)
![10 min timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/15_307694d9-3fe2-4996-a4b5-02fc69b1098b.png?v=1685933029)
10 Minute Timer Function Design Idea:
Building upon the existing setup, add an "if-then" function to display the corresponding lighting effects with the LEDs on CyberPi at specific intervals of the remaining time.
![10 min timer](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/16_345f063b-4982-4f3b-9e97-43481749615f.png?v=1685933612)
# Make A Note #
How to code and set a 10 minute timer?
Part I: Design a Countdown Function
--CyberPi repeatedly displays the time code until the 10 minute timer reaches zero.
Part II: Add LEDs to display the remaining time
--Building upon the existing setup, add an "if-then" function to display the corresponding lighting effects with the LEDs on CyberPi at specific intervals of the remaining time.
Part III: Display the countdown in minutes and seconds on your 10 min timer
--Minutes: remaining time divided by 60
--Seconds: remainder of the remaining time divided by 60