100 Top Tips: Microsoft Excel
Power up your Microsoft Excel skills with this powerful pocket-sized book of tips that will save you time and help you learn more from your spreadsheets.
15 December 2020
I recently came across the Pomodoro Technique for time management, which suggests you focus on a particular task for 25-minute periods, with short breaks in between the 25-minute sessions. The aim is to reduce interruptions and help to achieve flow, when you are fully in the zone and focused on a task. Pomodoro is Italian for tomato, and the technique is named after the tomato-shaped kitchen timer that the technique's author, Francesco Cirillo, used.
I have found this technique useful in the past, and was thinking about getting a timer to help me with it. There is a nice online pomodoro timer here, and there are countless phone apps available (some on subscription). Ideally, I wanted something I could see all the time, without having to fiddle with my phone, or give over screen space to an on-screen counter. A kitchen timer would probably be noisy, clicking away as it counted down the time. Sand timers are appealing, but only show the time remaining approximately. There are some nice desktop timers, like the one pictured, but I wasn't sure I wanted the clutter.
So, I coded my own pomodoro timer using the micro:bit. The device is a really good fit for this application in many ways. Most obviously, it has 25 LEDs, which is one for each minute of the work session we're timing. I already had one here too, so it was easy to try it out. If you don't already have a micro:bit, it costs about the same as a dedicated clock or sand timer but is smaller and programmable for other purposes.
Here's the code I wrote:
# Pomodoro timer for micro:bit - by Sean McManus - www.sean.co.uk
from microbit import *
import time
display.scroll('Pomodoro')
display.show(Image.HEART)
while True:
if button_a.is_pressed():
display.clear()
for y in range(0,5):
for x in range(0,5):
for brightness in range(0,10):
display.set_pixel(x,y,brightness)
time.sleep(6)
while not button_b.is_pressed():
display.clear()
time.sleep(0.5)
display.show(Image.HEART)
time.sleep(0.5)
When the micro:bit powers on, it displays the word "Pomodoro" on the LEDs. It's a useful reminder to me of what program I've loaded onto the device if I come back to it later. It then displays a heart. When you press the A button, the heart disappears and the timer begins. Working from left to right and top to bottom, the lights illuminate in turn. There are 10 brightness levels, so every six seconds the current light notches up its brightness, fading gradually in to full brightness. When the time runs out, the heart image flashes on and off to get your attention until you press the B button. If you get the new v2 micro:bit, it has a speaker built in so you could add an alarm, but I've found the flashing in the corner of my eye is enough to tell me time's up.
I leave the micro:bit plugged into my PC on a USB cable so it switches on when I turn the PC on. You could use it with a battery pack.
Here are four things I learned on this small project:
If you want to create your own Pomodoro timer, you can paste the code above into the Python editor for the micro:bit, modify it as you wish, and then download it as a .hex file to go on the micro:bit.
Image credit: Bonneval Sebastien via Unsplash. Thank you, Bonneval!
Permanent link for this post | Blog Home | Website Home | Email feedback
© Sean McManus. All rights reserved.
Visit www.sean.co.uk for free chapters from Sean's coding books (including Mission Python, Scratch Programming in Easy Steps and Coder Academy) and more!
Power up your Microsoft Excel skills with this powerful pocket-sized book of tips that will save you time and help you learn more from your spreadsheets.
This book, now fully updated for Scratch 3, will take you from the basics of the Scratch language into the depths of its more advanced features. A great way to start programming.
Code a space adventure game in this Python programming book published by No Starch Press.
Discover how to make 3D games, create mazes, build a drum machine, make a game with cartoon animals and more!
Set up your Raspberry Pi, then learn how to use the Linux command line, Scratch, Python, Sonic Pi, Minecraft and electronics projects with it.
In this entertaining techno-thriller, Sean McManus takes a slice through the music industry: from the boardroom to the stage; from the studio to the record fair.