Hacker Public Radio

HPR4075: Making a Pomodoro Timer


Listen Later

Making a Pomodoro Timer
Slacking Off at work
I get distracted Easy
My mind drifts if I try to focus on a single task For more than
20-30 Minutes.
If I try to fight the urge to just keep working my productivity goes
way down.
I end up working for a bit, then slacking off for half an hour.
I can get more work done If I embrace my limitation and force myself
to take a break.
Pomodoro Technique
From Wikipedia https://en.wikipedia.org/wiki/Pomodoro_Technique
The Pomodoro Technique is a time management method developed by
Francesco Cirillo in the late 1980s. It uses a kitchen timer to break
work into intervals, typically 25 minutes in length, separated by short
breaks. Each interval is known as a Pomodoro, from the Italian word for
tomato, after the tomato-shaped kitchen timer Cirillo used as a
university student.
The Timer
There are plenty of Pomodoro Apps I've tried using an app, but I
would often forget.
I wanted a physical device that was always on by desk and could grab
my attention.
I looked for a dedicated physical Pomodoro timer, but only found the
kitchen timers
I decided to make myself a timer using a Circuit Playground
Express
Circuit Playground Express
In my past episode about using a Pi pico to type passwords I
mentioned I owned a playground express.
The playground express is a micro controller with a lot of built ins
2 buttons
10 multi color LED
...
Runs circuit python with lots of libraries so it is easy to
program.
TDD
About once every other year I decided to start a project with as
much TDD as I can.
TDD Basics
Write a test BEFORE you write the code
Run the test - It will fail
Write the simplest code that will pass the test
Run the test and make sure it passes
Refactor/improve the code if needed.
TDD advantages
Code is easy to separate into discrete functions
Parts of the code can be rewritten without affecting the rest
confidence in rewrites
pomodoro.py
Circuit python looks for and runs a file named
code.py
A lot of the circuit Python code has to be run on the micro
controller
My Developers workstation does not have the LED's or buttons
I split the some code into a separate file based on if it could run
in "regular" python.
I used TDD as much as possible to test the functions in
pomodoro.py
code.py
BREAK_MINUTES = 5
WORK_MINUTES = 25
Functions that require hardware
No tests.
counts down and changes color of led
minutes divided by number of LED
Using the timer
Ready
Green Light next to button to start work Period
Blue Light next to button to start break Period
Working
White Background
Green progress pixels
Break
White Background
Blue progress pixels
Button A
Start working
Button B
Start Break
Links
https://gitlab.com/norrist/circuit_playground_pomodoro
https://circuitpython.org/downloads
...more
View all episodesView all episodes
Download on the App Store

Hacker Public RadioBy Hacker Public Radio

  • 4.2
  • 4.2
  • 4.2
  • 4.2
  • 4.2

4.2

34 ratings


More shows like Hacker Public Radio

View all
Security Now (Audio) by TWiT

Security Now (Audio)

1,970 Listeners

Off The Hook by 2600 Enterprises

Off The Hook

117 Listeners

No Agenda Show by Adam Curry & John C. Dvorak

No Agenda Show

5,942 Listeners

The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

283 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

265 Listeners

BSD Now by JT Pennington

BSD Now

89 Listeners

Open Source Security by Josh Bressers

Open Source Security

43 Listeners

Late Night Linux by The Late Night Linux Family

Late Night Linux

154 Listeners

The Linux Cast by The Linux Cast

The Linux Cast

35 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

7,876 Listeners

This Week in Linux by TuxDigital Network

This Week in Linux

36 Listeners

Linux Dev Time by The Late Night Linux Family

Linux Dev Time

21 Listeners

Hacking Humans by N2K Networks

Hacking Humans

314 Listeners

2.5 Admins by The Late Night Linux Family

2.5 Admins

92 Listeners

Linux Matters by Linux Matters

Linux Matters

20 Listeners