# Matrix Portal M4 Boxing Interval Timer

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/118/883/medium800thumb/leds_ezgif.com-video-to-gif_%281%29.jpg?1677252784)

Transform your home into your own boxing gym with this Matrix Portal M4 Boxing Interval Timer.&nbsp;This guide will show you how to assemble and program your own Boxing Interval Timer using CircuitPython.

This features the Matrix Portal M4, which easily drives a 64 x 32 RGB Matrix display with over 200 colorful LEDs to display the timer with excellent visibility - even for the largest gyms!

The timer uses an IBM Plex mono typeface, using a neon green hue for the first minute and thirty seconds for workout time. The text color changes to a yellowish-amber color for the cooldown portion of the time and red for the resting time.

## Parts
Featured
### Adafruit Matrix Portal Starter Kit - ADABOX 016 Essentials

[Adafruit Matrix Portal Starter Kit - ADABOX 016 Essentials](https://www.adafruit.com/product/4812)
If you missed out on [AdaBox016](https://www.youtube.com/watch?v=Yr3F8EBAVBU), it's not too late for you to pick up the parts necessary to build many of the projects! It doesn't come with tissue paper or the nifty extras, but it does have all the electronic goodies you...

In Stock
[Buy Now](https://www.adafruit.com/product/4812)
[Related Guides to the Product](https://learn.adafruit.com/products/4812/guides)
![Top view of kit contents for MatrixPortal Starter kit.](https://cdn-shop.adafruit.com/640x480/4812-00.jpg)

Featured
### Adafruit Matrix Portal - CircuitPython Powered Internet Display

[Adafruit Matrix Portal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4745)
Folks love our [wide selection of RGB matrices](https://www.adafruit.com/category/327) and accessories, for making custom colorful LED displays... and our RGB Matrix Shields and FeatherWings can be quickly soldered together to make the wiring much easier. But what if we made it...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4745)
[Related Guides to the Product](https://learn.adafruit.com/products/4745/guides)
![Video of a person rotating an LED matrix panel with animation resembling falling colored sand.](https://cdn-shop.adafruit.com/product-videos/640x480/4745-05.jpg)

Featured
### Black LED Diffusion Acrylic Panel - 10.2" x 5.1"

[Black LED Diffusion Acrylic Panel - 10.2" x 5.1"](https://www.adafruit.com/product/4749)
&nbsp;nice whoppin' rectangular slab of some lovely black acrylic to add some extra diffusion to your LED Matrix project. This material is 2.6mm (0.1") thick and is made of special cast acrylic that makes it perfect for glowy projects, especially matrices or NeoPixels.

Unlike...

In Stock
[Buy Now](https://www.adafruit.com/product/4749)
[Related Guides to the Product](https://learn.adafruit.com/products/4749/guides)
![LED RGB matrix 10.2" x 5.1" with "Adafruit Industries LED Matrix" text showing, and LED acrylic slowly covering to make it nicely diffused](https://cdn-shop.adafruit.com/product-videos/640x480/4749-02.jpg)

Featured
### 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable

[5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable](https://www.adafruit.com/product/1995)
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering single-board computers like Raspberry Pi, BeagleBone, or anything else that's power-hungry!

This adapter was specifically designed to provide 5.25V, not 5V, but we still call it a 5V USB...

In Stock
[Buy Now](https://www.adafruit.com/product/1995)
[Related Guides to the Product](https://learn.adafruit.com/products/1995/guides)
![MicroUSB power supply with bundled cable and U.S. plugs.](https://cdn-shop.adafruit.com/640x480/1995-02.jpg)

Featured
### Micro B USB to USB C Adapter

[Micro B USB to USB C Adapter](https://www.adafruit.com/product/4299)
As technology changes and adapts, so does Adafruit, and speaking of&nbsp;_adapting_, this&nbsp;_ **adapter** _&nbsp;has a Micro B USB jack&nbsp;and a USB C plug.

USB C is the latest industry-standard connector for transmitting data&nbsp;_and_&nbsp;power....

In Stock
[Buy Now](https://www.adafruit.com/product/4299)
[Related Guides to the Product](https://learn.adafruit.com/products/4299/guides)
![Angled shot of Micro B USB to USB C Adapter.](https://cdn-shop.adafruit.com/640x480/4299-02.jpg)

# Matrix Portal M4 Boxing Interval Timer

## Prep the MatrixPortal

## Power Prep

The MatrixPortal supplies power to the matrix display panel via two standoffs. These come with protective tape applied (part of our manufacturing process) which MUST BE REMOVED!

Use some tweezers or a fingernail to remove the two amber circles.

![adafruit_io_mxprtl-3866.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/902/medium640/adafruit_io_mxprtl-3866.jpg?1600706317)

![adafruit_io_mxprtl-3867.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/903/medium640/adafruit_io_mxprtl-3867.jpg?1600706324)

## Power Terminals

Next, screw in the spade connectors to the corresponding standoff.

- **red** wire goes to **+5V** &nbsp;
- **black** wire goes to **GND**

![adafruit_io_mxprtl-3869.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/907/medium640/adafruit_io_mxprtl-3869.jpg?1600706432)

![adafruit_io_mxprtl-3871.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/908/medium640/adafruit_io_mxprtl-3871.jpg?1600706551)

## Panel Power

Plug either one of the four-conductor power plugs into the power connector pins on the panel. The plug can only go in one way, and that way is marked on the board's silkscreen.

![adafruit_io_mxprtl-3872.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/910/medium640/adafruit_io_mxprtl-3872.jpg?1600706597)

![adafruit_io_mxprtl-3873.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/911/medium640/adafruit_io_mxprtl-3873.jpg?1600706672)

## Dual Matrix Setup

If you're planning to use a 64x64 matrix, [follow these instructions on soldering the Address E Line jumper](https://learn.adafruit.com/adafruit-matrixportal-m4/pinouts#address-e-line-jumper-3072815).

## Board Connection

Now, plug the board into the left side shrouded 8x2 connector as shown. The orientation matters, so take a moment to confirm that the **white indicator arrow on the matrix panel is oriented pointing up and right** as seen here and the MatrixPortal overhangs the edge of the panel when connected. This allows you to use the edge buttons from the front side.

&nbsp;

Check nothing is impeding the board from plugging in firmly. If there's a plastic nub on the matrix that's keeping the Portal from sitting flat, cut it off with diagonal cutters

![adafruit_io_mxprtl-3874.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/912/medium640/adafruit_io_mxprtl-3874.jpg?1600706721)

![adafruit_io_mxprtl-3875.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/913/medium640/adafruit_io_mxprtl-3875.jpg?1600706732)

![](https://cdn-learn.adafruit.com/assets/assets/000/094/914/medium800/adafruit_io_mxprtl-3876.jpg?1600706891)

![](https://cdn-learn.adafruit.com/assets/assets/000/094/915/medium800/adafruit_io_mxprtl-3877.jpg?1600706894)

Info: 

# Matrix Portal M4 Boxing Interval Timer

## LED Matrix Diffuser

## LED Diffusion Acrylic

You can add an [LED diffusion acrylic faceplate](https://www.adafruit.com/product/4594) to the your LED matrix display. (Pictured here with the [ON AIR project](https://learn.adafruit.com/rgb-matrix-automatic-youtube-on-air-sign))

This can help protect the LEDs as well as enhance the look of the sign both indoors and out by reducing glare and specular highlights of the plastic matrix grid.

![led_matrices_onairbuild-3367.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/987/medium640/led_matrices_onairbuild-3367.jpg?1597088161)

## Measure and Cut the Plastic

You can use the sign to measure and mark cut lines on the paper backing of the acrylic sheet.

Then, use a tablesaw or bandsaw with a fine toothed blade and a guide or sled to make the cuts.

Note: it is possible to score and snap acrylic, but it can be very tricky to get an even snap without proper clamping.

![led_matrices_onairbuild-3343.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/988/medium640/led_matrices_onairbuild-3343.jpg?1597088278)

![led_matrices_onairbuild-3346.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/989/medium640/led_matrices_onairbuild-3346.jpg?1597088290)

![led_matrices_onairbuild-3347.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/991/medium640/led_matrices_onairbuild-3347.jpg?1597089259)

![led_matrices_onairbuild-3349.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/992/medium640/led_matrices_onairbuild-3349.jpg?1597089270)

![](https://cdn-learn.adafruit.com/assets/assets/000/093/998/medium800/led_matrices_onairbuild-3352.jpg?1597089308)

Peel away the paper backing from both sides and set the acrylic onto your matrix display with the matte finished side facing out.

![led_matrices_onairbuild-3355.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/999/medium640/led_matrices_onairbuild-3355.jpg?1597089331)

## Uglu Dashes

The best method we've found for adhering acrylic to the matrix display is to use [Uglu Dashes clear adhesive rectangles from Pro Tapes](https://www.protapes.com/products/uglu-600-dashes-sheets). They are incredibly strong (although can be removed if necessary), easy to apply, and are invisible once attached.

Use one at each corner and one each at the halfway point of the long edges, then press the acrylic and matrix panel together for about 20 seconds.

![adafruit_io_weathermx-2-3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/842/medium640/adafruit_io_weathermx-2-3.jpg?1600463849)

![adafruit_io_weathermx-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/843/medium640/adafruit_io_weathermx-2.jpg?1600463856)

![adafruit_io_weathermx-2-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/844/medium640/adafruit_io_weathermx-2-2.jpg?1600463866)

Here you can see the impact of using the diffusion acrylic. (Pictured here with the ON AIR sign project)

![](https://cdn-learn.adafruit.com/assets/assets/000/094/006/medium800thumb/led_matrices_diffusionOnAir.jpg?1597089757)

## Stand

A very simple and attractive way to display your matrix is with the adjustable [bent-wire stand](https://www.adafruit.com/product/1679).

![led_matrices_onairbuild-3418.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/032/medium640/led_matrices_onairbuild-3418.jpg?1597094067)

![led_matrices_onairbuild-3419.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/033/medium640/led_matrices_onairbuild-3419.jpg?1597094085)

![led_matrices_onairbuild-3421.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/034/medium640/led_matrices_onairbuild-3421.jpg?1597094097)

![led_matrices_onairbuild-3422.jpg](https://cdn-learn.adafruit.com/assets/assets/000/094/035/medium640/led_matrices_onairbuild-3422.jpg?1597094107)

![](https://cdn-learn.adafruit.com/assets/assets/000/095/378/medium800/adafruit_io_led_matrices_onairbuild-3383.jpg?1602006263)

Alternately, you can use a frame, [3D printed brackets](https://learn.adafruit.com/led-protest-sign/build-the-sign#step-3065326), tape, glue, or even large binder clips to secure the acrylic to the sign and then mount it on on a wall, shelf, or display cabinet.

[These mini-magnet feet](https://www.adafruit.com/product/4631) can be used to stick the sign to a ferrous surface.

# Matrix Portal M4 Boxing Interval Timer

## Install CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## Set up CircuitPython Quick Start!

Follow this quick step-by-step for super-fast Python power :)

[Download the latest version of CircuitPython for this board via circuitpython.org](https://circuitpython.org/board/matrixportal_m4/)
## Further Information

For more detailed info on installing CircuitPython, check out [Installing CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython).

 **Click the link above and download the latest UF2 file.**

Download and save it to your desktop (or wherever is handy).

![led_matrices_Save_to_Desktop.png](https://cdn-learn.adafruit.com/assets/assets/000/095/075/medium640/led_matrices_Save_to_Desktop.png?1601050695)

Plug your MatrixPortal M4 into your computer using a known-good USB cable.

**A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.**

Double-click the **Reset** button (indicated by the green arrow) on your board, and you will see the NeoPixel RGB LED (indicated by the magenta arrow) turn green. If it turns red, check the USB cable, try another USB port, etc.

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

![led_matrices_matrixportal_install_cp.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/447/medium640/led_matrices_matrixportal_install_cp.jpg?1697644568)

You will see a new disk drive appear called **MATRIXBOOT**.

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to **MATRIXBOOT****.**

![led_matrices_MATRIXBOOT.png](https://cdn-learn.adafruit.com/assets/assets/000/125/448/medium640/led_matrices_MATRIXBOOT.png?1697644692)

![led_matrices_Drag_to_Drive.png](https://cdn-learn.adafruit.com/assets/assets/000/125/449/medium640/led_matrices_Drag_to_Drive.png?1697644703)

The LED will flash. Then, the **MATRIXBOOT** &nbsp;drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![led_matrices_circuitpy.png](https://cdn-learn.adafruit.com/assets/assets/000/125/450/medium640/led_matrices_circuitpy.png?1697645066)

# Matrix Portal M4 Boxing Interval Timer

## Custom Font

![](https://cdn-learn.adafruit.com/assets/assets/000/094/098/medium800/led_matrices_plex.png?1597452353)

Instead of the default Terminal typeface, we'll use a lovely typeface converted to a bitmap font for use on the matrix display.

In case you want to make your own font, [this excellent guide](https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display/overview) shows how to use FontForge to do just that!

I selected the [IBM Plex Mono Medium](https://www.ibm.com/plex/) typeface. I then converted it to a single bitmap font in a size that works for the 64x32 pixel matrix display, and hand kerned the colon and space characters. Here is the modified .bdf font:

[IBMPlexMono-Medium-24_jep.bdf.zip](https://cdn-learn.adafruit.com/assets/assets/000/094/096/original/IBMPlexMono-Medium-24_jep.bdf.zip?1597451956)
To use it, download and uncompress the zip file and then drag it onto the board's **CIRCUITPY** drive. In CircuitPython, the font is loaded so it can be used for text display.

## Glyph Bitmap Distribution Format

Side note about **Glyph Bitmap Distribution Format** (BDF) fonts -- they are stored as text files that are human and computer readable, and you can even edit them by hand if you feel like getting super particular!

Here's what the letter 'A' glyph looks like in a typical converted .bdf font:

```python
STARTCHAR A
ENCODING 65
SWIDTH 681 0
DWIDTH 14 0
BBX 13 15 1 0
BITMAP
0200
0600
0700
0F00
0F00
0980
1980
18C0
30C0
3FC0
7FE0
6060
6030
C030
C018
ENDCHAR
```

Each of those lines after the word `BITMAP` is a hexidecimal pixel mapping of a row of the glyph. Here's what that looks like converted to binary, with each row padded to 16-bits:

```none
0000001000000000
0000011000000000
0000011100000000
0000111100000000
0000111100000000
0000100110000000
0001100110000000
0001100011000000
0011000011000000
0011111111000000
0111111111100000
0110000001100000
0110000000110000
1100000000110000
1100000000011000
```

Here's what that 'A' looks like rendered on the 64x32 3mm pitch matrix display.

![led_matrices_A.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/802/medium640/led_matrices_A.jpg?1596557075)

## Glyph Tweaks

In case you wanted to add a stylish hat on top of your 'A', you could change the first row to: `1fc0` which is `0001111111000000` in binary.

This would result it the image to the left.

![led_matrices_Ahat.jpg](https://cdn-learn.adafruit.com/assets/assets/000/093/803/medium640/led_matrices_Ahat.jpg?1596557800)

Now, that's a bit of a silly example, but the great thing about this is that you can fine-tune your glyphs beyond what may be easily accomplished during the conversion process.

# Matrix Portal M4 Boxing Interval Timer

## Code the Interval Timer

After completing the setup process for your Matrix Portal M4 with CircuitPython, you can gather the required code and libraries by downloading the **Project Bundle**.

To accomplish this task, click the "Download Project Bundle" button in the window below. The file will be saved to your computer as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Matrix_Portal/Matrix_Portal_M4_Boxing_Interval_Timer/code.py

## Text Editor

Adafruit recommends using the Mu editor for editing your CircuitPython code. You can get more info in [this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor)&nbsp;including info on how to use the REPL/serial terminal.

Alternatively, you can use any text editor that saves simple text files.

## Upload the Code and Libraries to the Matrix Portal M4

After downloading the Project Bundle, you can plug your Matrix Portal M4 into the computer's USB port with a suitable USB data+power cable. You should see a new flash drive in the computer's File Explorer or Finder (depending on your operating system) called&nbsp; **CIRCUITPY**. Unzip the folder and copy the following items to the Matrix Portal M4's&nbsp; **CIRCUITPY** &nbsp;drive.&nbsp;

- **lib** &nbsp;folder
- **code.py**
- **IBMPlexMono-Medium-24\_jep.bdf**

Your Matrix Portal M4&nbsp; **CIRCUITPY&nbsp;** drive should look like this after copying the&nbsp; **lib** &nbsp;folder, **IBMPlexMono-Medium-24\_jep.bdf**** &nbsp; **file and the&nbsp;** code.py&nbsp;**file.

![](https://cdn-learn.adafruit.com/assets/assets/000/118/891/medium800/led_matrices_Screen_Shot_2023-02-24_at_2.08.42_PM.png?1677266455)

## Import Libraries

First thing is to import the modules needed for the code to run. The `time` module allows you to work with time, while the `displayio` and `terminalio` provide classes and methods to render the text to the display.

The `adafruit_bitmap_font` module supports bitmap fonts, and the `adafruit_matrixportal` module supports working with the Matrix Portal.

```auto
import time
import displayio
import terminalio
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
from adafruit_matrixportal.matrix import Matrix
```

## Constants&nbsp;

These constants are used throughout the code. `TIMER_LENGTH` sets the length of the countdown timer in seconds, `BLINK` determines whether the timer's colon separator blinks, and `DEBUG` allows you to see debug information in the console.

```auto
TIMER_LENGTH = 180  # 3 minutes
BLINK = True
```

## Initializing the Matrix Portal

This code initializes the Matrix Portal and sets it up as a display object. Very important.

```python
matrix = Matrix()
display = matrix.display
```

## Drawing setup

Now, to set up the display's drawing objects. Create a &nbsp;`Group` to hold the tile grid and a Bitmap object to represent the display's pixels. You also want to create a Palette to hold the colors used in the display. The TileGrid is created using the Bitmap and Palette and is added to the `Group`. Finally, the Group is shown on the display.

```python
group = displayio.Group()  # Create a Group
bitmap = displayio.Bitmap(64, 32, 2)  # Create a bitmap object,width, height, bit depth
color = displayio.Palette(4)  # Create a color palette
color[0] = 0x000000  # black background
color[1] = 0xFF0000  # red
color[2] = 0xFF8C00  # yellow
color[3] = 0x3DEB34  # green
```

## Font&nbsp;

This set of code sets up the font for the countdown interval timer. If `DEBUG` is set to `False`, a bitmap font is loaded from a file. If not, the font is used.

```python
if not DEBUG:
    font = bitmap_font.load_font("/IBMPlexMono-Medium-24_jep.bdf")
else:
    font = terminalio.FONT
```

## Label setup

This line creates a `Label` object using the previously loaded font.

```python
clock_label = Label(font)
```

## Update Time

This&nbsp;`update_time()` function takes one argument `remaining_time` as input.

Within the function, it first calls `time.localtime()` to observe and store the current local time in the variable.

Next, it calculates the number of minutes and seconds remaining from the input argument `remaining_time` in seconds.

The code then determines if it displays a blinking colon or not based on the value of the `BLINK` variable and the current second of the `now` variable. It sets the `colon` variable to `:` if the current second is even and if the current second is odd.

It then sets the text&nbsp;of the `clock_label` object to display the minutes and seconds, with the `colon`. The values are formatted to display leading zeros when necessary.

The code block then sets the color of the `clock_label` object based on the remaining time. Here's the. condition:

- If the remaining time is less than 60 seconds, it sets the color to `color[1]`.
- If it's less than 90 seconds, it sets the color to `color[2]`.
- If it's greater than 90 seconds, it sets the color to `color[3]`.

The code then calculates the bounding box of the `clock_label` object and centers it horizontally on the screen. If the `DEBUG` variable is set to `True`, it prints the bounding box and position of the label.

Finally, the code decrements the `remaining_time` variable by 1 and checks if it's less than 0. If the `remaining_time` is equal to 0, it sets `remaining_time` back to `TIMER_LENGTH`, another variable that must have been defined elsewhere in the code. The function then returns the `remaining_time` variable.

The `main()` function initializes the `remaining_time` variable to `TIMER_LENGTH`, calls `update_time()` with that variable as input, and appends the `clock_label` object to a `group`. Then it enters a `while` loop that repeatedly calls `update_time()` with the current value of `remaining_time`, sleeps for 1 second using `time.sleep(1)`, and continues the loop.

```auto
def update_time(remaining_time):
    now = time.localtime()  # Get the time values we need

    # calculate remaining time in seconds
    seconds = remaining_time % 60
    minutes = remaining_time // 60

    if BLINK:
        colon = ":" if now[5] % 2 else " "
    else:
        colon = ":"

    clock_label.text = "{minutes:02d}{colon}{seconds:02d}".format(
        minutes=minutes, seconds=seconds, colon=colon
    )

    if remaining_time < 60:
        clock_label.color = color[1]
    elif remaining_time < 90:
        clock_label.color = color[2]
    elif remaining_time > 90:
        clock_label.color = color[3]

    bbx, bby, bbwidth, bbh = clock_label.bounding_box
    # Center the label
    clock_label.x = round(display.width / 2 - bbwidth / 2)
    clock_label.y = display.height // 2
    if DEBUG:
        print("Label bounding box: {},{},{},{}".format(bbx, bby, bbwidth, bbh))
        print("Label x: {} y: {}".format(clock_label.x, clock_label.y))

    # decrement remaining time
    remaining_time -= 1
    if remaining_time < 0:
        remaining_time = TIMER_LENGTH

    return remaining_time

def main():
    remaining_time = TIMER_LENGTH
    update_time(remaining_time)
    group.append(clock_label)

    while True:
        remaining_time = update_time(remaining_time)
        time.sleep(1)

if __name__ == "__main__":
    main()
```

# Matrix Portal M4 Boxing Interval Timer

## Use

![](https://cdn-learn.adafruit.com/assets/assets/000/118/910/medium800/led_matrices_timer_use_hero.png?1677510480)

After writing and uploading your code to your Matrix portal, you should see a bright green countdown timer displayed.&nbsp;Now you can disconnect your timer from your computer, and with your AC adapter, you will be able to use your countdown timer anywhere an electrical outlet is available.

You can also turn this boxing interval timer into a Pomodoro timer to use the Pomodoro technique!

![](https://cdn-learn.adafruit.com/assets/assets/000/118/911/medium800thumb/led_matrices_ezgif.com-optimize_%281%29.jpg?1677510504)

## Pomodoro Timer

The&nbsp; **Pomodoro Technique** &nbsp;is a&nbsp;[time management](https://en.wikipedia.org/wiki/Time_management) method developed by Francesco Cirillo in the late 1980s. It uses a&nbsp;[kitchen timer](https://en.wikipedia.org/wiki/Kitchen_timer)&nbsp;to break work into intervals, typically 25 minutes in length, separated by short breaks. Each interval is known as a&nbsp;_Pomodoro_, from the&nbsp;[Italian](https://en.wikipedia.org/wiki/Italian_language)&nbsp;word for&nbsp;[tomato](https://en.wikipedia.org/wiki/Tomato), after the tomato-shaped kitchen timer Cirillo used as a university student.

To change this timer's countdown time, update the following time:

```auto
TIMER_LENGTH = 1500  # 25 minutes
```

You can also make the timer's text red like a tomato! By updating this line:

```auto
elif remaining_time > 90:
        clock_label.color = color[1]
```


## Guide Products

### Adafruit Matrix Portal Starter Kit - ADABOX 016 Essentials

[Adafruit Matrix Portal Starter Kit - ADABOX 016 Essentials](https://www.adafruit.com/product/4812)
If you missed out on [AdaBox016](https://www.youtube.com/watch?v=Yr3F8EBAVBU), it's not too late for you to pick up the parts necessary to build many of the projects! It doesn't come with tissue paper or the nifty extras, but it does have all the electronic goodies you...

In Stock
[Buy Now](https://www.adafruit.com/product/4812)
[Related Guides to the Product](https://learn.adafruit.com/products/4812/guides)
### Adafruit Matrix Portal - CircuitPython Powered Internet Display

[Adafruit Matrix Portal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4745)
Folks love our [wide selection of RGB matrices](https://www.adafruit.com/category/327) and accessories, for making custom colorful LED displays... and our RGB Matrix Shields and FeatherWings can be quickly soldered together to make the wiring much easier. But what if we made it...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4745)
[Related Guides to the Product](https://learn.adafruit.com/products/4745/guides)
### Black LED Diffusion Acrylic Panel - 10.2" x 5.1"

[Black LED Diffusion Acrylic Panel - 10.2" x 5.1"](https://www.adafruit.com/product/4749)
&nbsp;nice whoppin' rectangular slab of some lovely black acrylic to add some extra diffusion to your LED Matrix project. This material is 2.6mm (0.1") thick and is made of special cast acrylic that makes it perfect for glowy projects, especially matrices or NeoPixels.

Unlike...

In Stock
[Buy Now](https://www.adafruit.com/product/4749)
[Related Guides to the Product](https://learn.adafruit.com/products/4749/guides)
### 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable

[5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable](https://www.adafruit.com/product/1995)
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering single-board computers like Raspberry Pi, BeagleBone, or anything else that's power-hungry!

This adapter was specifically designed to provide 5.25V, not 5V, but we still call it a 5V USB...

In Stock
[Buy Now](https://www.adafruit.com/product/1995)
[Related Guides to the Product](https://learn.adafruit.com/products/1995/guides)
### Micro B USB to USB C Adapter

[Micro B USB to USB C Adapter](https://www.adafruit.com/product/4299)
As technology changes and adapts, so does Adafruit, and speaking of&nbsp;_adapting_, this&nbsp;_ **adapter** _&nbsp;has a Micro B USB jack&nbsp;and a USB C plug.

USB C is the latest industry-standard connector for transmitting data&nbsp;_and_&nbsp;power....

In Stock
[Buy Now](https://www.adafruit.com/product/4299)
[Related Guides to the Product](https://learn.adafruit.com/products/4299/guides)

## Related Guides

- [Adafruit MatrixPortal M4](https://learn.adafruit.com/adafruit-matrixportal-m4.md)
- [IOT IR Remote using Raspberry Pi Zero W and QtPy Hat](https://learn.adafruit.com/iot-ir-remote-using-raspberry-pi-zero-w-and-qtpy-hat.md)
- [Which CircuitPython Board is Right for You?](https://learn.adafruit.com/choose-your-circuitpython-board.md)
- [LED Matrix FIFA World Cup Scoreboard](https://learn.adafruit.com/led-matrix-fifa-world-cup-scoreboard.md)
- [Control an LED With Your Voice using Watson and Raspberry Pi](https://learn.adafruit.com/tjbot-control-an-led-with-your-voice-watson-on-raspberry-pi.md)
- [PyPortal Wake-Up Light Alarm Clock](https://learn.adafruit.com/pyportal-wake-up-light.md)
- [Expressive Pixels for Adafruit Matrix Portal](https://learn.adafruit.com/expressive-pixels-for-matrix-portal.md)
- [Halloween Countdown Display Matrix](https://learn.adafruit.com/halloween-countdown-display-matrix.md)
- [Wirelessly Program a Circuit Playground Bluefruit Using the File Glider App ](https://learn.adafruit.com/how-to-transfer-files-to-a-circuit-playground-bluefruit-using-the-fileglider-app.md)
- [Glowing Lotus Flower - Electronic Origami for Beginners](https://learn.adafruit.com/glowing-lotus-flower-electronic-origami-for-beginners.md)
- [ABC Soundboards with NeoTrellis](https://learn.adafruit.com/abc-soundboards-with-neotrellis.md)
- [Creating MagTag Projects with CircuitPython](https://learn.adafruit.com/creating-magtag-projects-with-circuitpython.md)
- [Weather Display Matrix](https://learn.adafruit.com/weather-display-matrix.md)
- [Matrix Portal Sand Handles](https://learn.adafruit.com/matrix-portal-sand.md)
- [IoT Power Outlet with CircuitPython and Adafruit IO](https://learn.adafruit.com/adafruit-io-a-c-power-relay.md)
- [MatrixPortal S3 Flight Proximity Tracker](https://learn.adafruit.com/matrixportal-s3-flight-proximity-tracker.md)
