Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr4075 :: Making a Pomodoro Timer

norrist uses the pomodoro method to keep from getting fired.

<< First, < Previous, , Latest >>

Hosted by norrist on Friday, 2024-03-15 is flagged as Clean and is released under a CC-BY-SA license.
circuit python, productivity. 2.
The show is available on the Internet Archive at: https://archive.org/details/hpr4075

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:19:50

general.

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

Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2024-03-15 11:13:17 by Trey

Great project

I like the idea of a Pomodoro timer for those of us who are easily distracted and then get so focused on a specific problem we forget to eat.

The Raspberry Pi pico reminds me of Arduino. Now I need to research and compare/contrast. I better set a timer. :)

Comment #2 posted on 2024-04-10 00:05:06 by operat0r

ADD

You got ADD brah...

https://rmccurdy.com/stuff/.tmp_tmp/_ADHD/Autism+Spectrum.png

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
Who is the host of this show?
What does HPR mean to you?