M5Stack Core2 Countdown Interval Gym Timer
2023-06-01 | By M5Stack
License: General Public License Wifi Arduino ESP32 M5Stack
* Thanks for the source code and project information provided by @Damien Norris
Software apps and online services
Story
I needed a timer for interval training as a part of a larger project and I usually like to get each individual component working independently before combining them together. As always, I searched the internet to see if anybody had done something similar that I could utilize when I came across the Wio Terminal Timer project from SeeedStudio and thought it looked interesting.
I also wanted to have a way to increase awareness of a GoFundMe campaign I am running for my son to help get over his severe mental breakdown and thought having something to show would be better than just asking for donations.
Features
- Allows the user to set the number of reps 1-99
- Users can set the workout time to the second
- users can set the rest time to the second
- Users can pause then resume or reset both the timers
- Alarm beeps for the last 5 seconds of each timer
Instructions
This countdown interval timer can be used in all kinds of activities right out the box, such as Boxing, HITT training, CrossFit, Sprint training and so on. It could also be easily adapted to suit other situations (you could even boil an egg with it :) )
Currently, the flow of the app is fairly straightforward: -
- Welcome Screen (Splash Screen)
Setup Screens
- Set Number of Reps
- Set Workout Timer
- Set Rest Timer
- Setup ScreensSet Number of RepsSet Workout TimerSet Rest Timer
Run Timer Screens
- Start Screen
- Run Workout Timer
- Run Rest Timer
- Repeat for Set Number of Reps
- End Timer Screen
- Run Timer ScreensStart ScreenRun Workout TimerRun Rest TimerRepeat for Set Number of RepsEnd Timer Screen
- End Timer Screen
Each of the screen groups has a fairly uniform button usage: -
M5.BtnA/B/C.wasPressed() means a single tap M5.BtnA/B/C.pressedFor(500) means the button needs to be pressed for a given amount of time
Setup Screens use M5.BtnA.wasPressed() & M5.BtnB.wasPressed() to decrease/increase the digit value that the cursor is under and M5.BtnC.wasPressed() to move the cursor. Holding M5.BtnC.pressedFor(500) navigate to the next screen, so from Num Reps Setup to Set Work Timer and so on.
On the Start Screen the user taps the M5.BtnB.wasPressed() to set the timer running.
Run Timer Screen use M5.BtnB.wasPressed() to pause the countdown and either M5.BtnB.wasPressed() to resume timing or M5.BtnA.pressedFor(500) to cancel and return to the Setup routine.
On the End Timer Screen the user presses M5.BtnB.pressedFor(500) to return to the setup routine.
It sounds more complicated than it actually is, and the video should clear things up nicely.
Code
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum