# Desk Calculator with CircuitPython

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/103/366/medium800thumb/projects_ezgif.com-optimize%287%29.jpg?1626183473)

Consider the humble calculator. Now just an app that you always have with you on your telephone, an electronic calculator used to be a [technological marvel](https://www.thecalculatorsite.com/articles/units/history-of-the-calculator.php).

In this project, you'll build your own calculator with an Adafruit Feather RP2040, 128x64 OLED display, and 20 keys. Optional 3D printed parts like an enclosure and even the keycaps themselves make for a sharp presentation. Make it your own by customizing the code, or use the hardware for your own MacroPad-inspired project.

## Custom Printed Circuit Board

This project needs a custom PCB. You can pick up the [KiCad](https://www.kicad.org/) (design) files or the Gerber (production) files below and upload them to the PCB house of your choice, or you can [use this link to order them from OSH Park](https://oshpark.com/shared_projects/Jmfp8iGD). You are free to modify the design files and use them in your own designs. (In copyright terms, the design files are [licensed as CC0](https://creativecommons.org/publicdomain/zero/1.0/))

OSH Park's standard turnaround is 9 to 12 days from order to shipment, so plan accordingly.

The board files were designed in [KiCad](https://www.kicad.org/), open source software that is free to download & use.

[Gerber Files for ordering PCB](https://github.com/adafruit/Adafruit_Learning_System_Guides/raw/main/CircuitPython_KeyPad_Calculator/design-files/pcb/calculator2/gerb.zip)
[PCB Design Files for KiCad](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/CircuitPython_KeyPad_Calculator/design-files/pcb/calculator2)
## Required Parts

Along with the custom PCB, you'll need basic tools, soldering supplies, and the Adafruit parts listed below.

### Adafruit Feather RP2040

[Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
A new chip means a new Feather, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the Feather Treatment" and so we did! This Feather features the&nbsp; **RP2040** , and all niceties you know and...

In Stock
[Buy Now](https://www.adafruit.com/product/4884)
[Related Guides to the Product](https://learn.adafruit.com/products/4884/guides)
![Angled shot of black rectangular microcontroller "Feather RP2040"](https://cdn-shop.adafruit.com/640x480/4884-04.jpg)

### Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather

[Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather](https://www.adafruit.com/product/4650)
A Feather board without ambition is a Feather board without FeatherWings! This is the&nbsp; **FeatherWing 128x64 OLED** : it adds a gorgeous 128x64 monochrome OLED plus 3 user buttons to&nbsp;_any_&nbsp;Feather main board. Using our&nbsp;<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4650)
[Related Guides to the Product](https://learn.adafruit.com/products/4650/guides)
![Video of a Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather - STEMMA QT / Qwiic connected to a temp and humidity sensor. Display reads "Adafruit" and various Temp and Humidity measures.  ](https://cdn-shop.adafruit.com/product-videos/640x480/4650-08.jpg)

### White Nylon Machine Screw and Stand-off Set – M2.5 Thread

[White Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3658)
Totaling 420 pieces, this **White Nylon&nbsp;M2.5 Screw Set** &nbsp;is a must-have smörgåsbord for your workstation.&nbsp;You'll have more than enough screws, nuts, and hex standoffs to construct&nbsp;your maker projects&nbsp;for days on end! M2.5 screws fit nearly...

In Stock
[Buy Now](https://www.adafruit.com/product/3658)
[Related Guides to the Product](https://learn.adafruit.com/products/3658/guides)
![White Nylon Screw and Stand-off Set with M2.5 Threads, kit box](https://cdn-shop.adafruit.com/640x480/3658-00.jpg)

### Pink and Purple Woven USB A to USB C Cable - 2 meters long

[Pink and Purple Woven USB A to USB C Cable - 2 meters long](https://www.adafruit.com/product/5044)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers and more.&nbsp; [If you want something just like it but for Micro B, we have a B...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5044)
[Related Guides to the Product](https://learn.adafruit.com/products/5044/guides)
![Angled shot of a pink/purple woven USB cable plugged into a laptop port and a small dev board.](https://cdn-shop.adafruit.com/640x480/5044-04.jpg)

### Header Kit for Feather - 12-pin and 16-pin Female Header Set

[Header Kit for Feather - 12-pin and 16-pin Female Header Set](https://www.adafruit.com/product/2886)
These two&nbsp; **Female&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

What do they do? They get soldered on either side of the Feather...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2886)
[Related Guides to the Product](https://learn.adafruit.com/products/2886/guides)
![Angled shot of a Header Kit for Feather - 12-pin and 16-pin Female Header Set. ](https://cdn-shop.adafruit.com/640x480/2886-00.jpg)

### Stacking Headers for Feather - 12-pin and 16-pin female headers

[Stacking Headers for Feather - 12-pin and 16-pin female headers](https://www.adafruit.com/product/2830)
These two **Female Stacking Headers** alone are, well, lonely. But pair them with any of our [Feather](https://www.adafruit.com/categories/777) boards and you're in business!

What do they do? They stack. Put the headers through your Feather and then you can...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2830)
[Related Guides to the Product](https://learn.adafruit.com/products/2830/guides)
![Angled shot of a Stacking Headers for Feather - 12-pin and 16-pin female headers. ](https://cdn-shop.adafruit.com/640x480/2830-08.jpg)

### 1N4148 Signal Diode - 10 pack

[1N4148 Signal Diode - 10 pack](https://www.adafruit.com/product/1641)
You have some electrons over here, and you want them over there but you don't want the electrons from over there to be able to come over here? That's what a diode is for, these are directional current valves and have the benefit of being waaay smaller than vacuum tubes.  
<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/1641)
[Related Guides to the Product](https://learn.adafruit.com/products/1641/guides)
![Ten pack of diodes](https://cdn-shop.adafruit.com/640x480/1641-02.jpg)

Info: 

### Kailh Mechanical Key Switches - Linear Red - 10 pack

[Kailh Mechanical Key Switches - Linear Red - 10 pack](https://www.adafruit.com/product/4952)
For crafting your very own custom keyboard, these **Kailh Red Linear mechanical key switches** are deeee-luxe! With smooth actuation and Cherry MX compatibility, they're lovely when you want a **smooth linear** keystroke:

- Type Linear
- Operating...

In Stock
[Buy Now](https://www.adafruit.com/product/4952)
[Related Guides to the Product](https://learn.adafruit.com/products/4952/guides)
![Angled shot of ten red Kailh key switches.](https://cdn-shop.adafruit.com/640x480/4952-00.jpg)

### Relegendable Plastic Keycaps for MX Compatible Switches 10 pack

[Relegendable Plastic Keycaps for MX Compatible Switches 10 pack](https://www.adafruit.com/product/5039)
Get ready&nbsp;to customize your keeb with a 10&nbsp;pack of two-part plastic keycaps for your next mechanical keyboard or&nbsp;[NeoKey](https://www.adafruit.com/?q=neokey&sort=BestMatch)&nbsp;project.

Each keycap comes with a off-white base and a clear cover piece. You...

In Stock
[Buy Now](https://www.adafruit.com/product/5039)
[Related Guides to the Product](https://learn.adafruit.com/products/5039/guides)
![Angled shot of ten white plastic keycaps.](https://cdn-shop.adafruit.com/640x480/5039-08.jpg)

### Little Rubber Bumper Feet - Pack of 4

[Little Rubber Bumper Feet - Pack of 4](https://www.adafruit.com/product/550)
Keep your electronics from going barefoot, give them little rubber feet! These small sticky bumpers are our favorite accessory for any electronic kit or device. They are sticky, but not impossible to remove. They're small enough to fit onto any board, and have just enough height to give...

In Stock
[Buy Now](https://www.adafruit.com/product/550)
[Related Guides to the Product](https://learn.adafruit.com/products/550/guides)
![Angled Shot of the Little Rubber Bumper Feet - Pack of 4](https://cdn-shop.adafruit.com/640x480/550-06.jpg)

## Optional parts
### Part: Tapered Heat-Set Inserts for Plastic
quantity: 1
Brass, M2.5 x 0.45 mm Thread Size, 3.4 mm Installed Length (Pack of 100)
[Tapered Heat-Set Inserts for Plastic](https://www.mcmaster.com/94180A321/)

- [Next Page](https://learn.adafruit.com/desk-calculator-with-circuitpython/3d-printed-parts.md)

## Featured Products

### Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather

[Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather](https://www.adafruit.com/product/4650)
A Feather board without ambition is a Feather board without FeatherWings! This is the&nbsp; **FeatherWing 128x64 OLED** : it adds a gorgeous 128x64 monochrome OLED plus 3 user buttons to&nbsp;_any_&nbsp;Feather main board. Using our&nbsp;<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4650)
[Related Guides to the Product](https://learn.adafruit.com/products/4650/guides)
### Adafruit Feather RP2040

[Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
A new chip means a new Feather, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the Feather Treatment" and so we did! This Feather features the&nbsp; **RP2040** , and all niceties you know and...

In Stock
[Buy Now](https://www.adafruit.com/product/4884)
[Related Guides to the Product](https://learn.adafruit.com/products/4884/guides)
### White Nylon Machine Screw and Stand-off Set – M2.5 Thread

[White Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3658)
Totaling 420 pieces, this **White Nylon&nbsp;M2.5 Screw Set** &nbsp;is a must-have smörgåsbord for your workstation.&nbsp;You'll have more than enough screws, nuts, and hex standoffs to construct&nbsp;your maker projects&nbsp;for days on end! M2.5 screws fit nearly...

In Stock
[Buy Now](https://www.adafruit.com/product/3658)
[Related Guides to the Product](https://learn.adafruit.com/products/3658/guides)
### Pink and Purple Woven USB A to USB C Cable - 2 meters long

[Pink and Purple Woven USB A to USB C Cable - 2 meters long](https://www.adafruit.com/product/5044)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers and more.&nbsp; [If you want something just like it but for Micro B, we have a B...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5044)
[Related Guides to the Product](https://learn.adafruit.com/products/5044/guides)
### Kailh Mechanical Key Switches - Linear Red - 10 pack

[Kailh Mechanical Key Switches - Linear Red - 10 pack](https://www.adafruit.com/product/4952)
For crafting your very own custom keyboard, these **Kailh Red Linear mechanical key switches** are deeee-luxe! With smooth actuation and Cherry MX compatibility, they're lovely when you want a **smooth linear** keystroke:

- Type Linear
- Operating...

In Stock
[Buy Now](https://www.adafruit.com/product/4952)
[Related Guides to the Product](https://learn.adafruit.com/products/4952/guides)
### Kailh Mechanical Key Switches - Tactile Brown - 10 pack

[Kailh Mechanical Key Switches - Tactile Brown - 10 pack](https://www.adafruit.com/product/4954)
For crafting your very own custom keyboard, these **&nbsp;Kailh Brown Linear mechanical key switches** &nbsp;are deeee-luxe! With smooth actuation and Cherry MX compatibility, they're lovely when you want a **tactile keystroke** - it's not clicky like the...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4954)
[Related Guides to the Product](https://learn.adafruit.com/products/4954/guides)
### Kailh Mechanical Key Switches - Clicky White - 10 pack

[Kailh Mechanical Key Switches - Clicky White - 10 pack](https://www.adafruit.com/product/4955)
For crafting your very own custom keyboard, these **&nbsp;Kailh&nbsp;White Linear mechanical key switches** &nbsp;are deeee-luxe! With smooth actuation and Cherry MX compatibility, they're lovely when you want a **clicky tactile** keystroke with a snappy feel and an...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4955)
[Related Guides to the Product](https://learn.adafruit.com/products/4955/guides)
### Kailh Mechanical Key Switches - Linear Black - 10 pack

[Kailh Mechanical Key Switches - Linear Black - 10 pack](https://www.adafruit.com/product/4953)
For crafting your very own custom keyboard, these **&nbsp;Kailh Black&nbsp;Linear mechanical key switches** &nbsp;are deeee-luxe! With smooth actuation and Cherry MX compatibility, they're lovely when you want a&nbsp; **smooth linear&nbsp;** keystroke with a...

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

## Related Guides

- [Adafruit 128x64 OLED FeatherWing ](https://learn.adafruit.com/adafruit-128x64-oled-featherwing.md)
- [Introducing Adafruit Feather RP2040](https://learn.adafruit.com/adafruit-feather-rp2040-pico.md)
- [How to Choose a Microcontroller](https://learn.adafruit.com/how-to-choose-a-microcontroller.md)
- [CNC Rotary Macropad](https://learn.adafruit.com/cnc-rotary-macropad.md)
- [MIDI for Makers](https://learn.adafruit.com/midi-for-makers.md)
- [CircuitPython USB VID/PID Reporter](https://learn.adafruit.com/circuitpython-usb-vid-pid-reporter.md)
- [Numpad 4000 Mechanical Keyswitch Data Entry Device](https://learn.adafruit.com/numpad-4000-mechanical-keyswitch-data-entry-device.md)
- [Hacking Holiday Animatronics](https://learn.adafruit.com/hacking-holiday-animatronics.md)
- [Cooperative Multitasking in CircuitPython with asyncio](https://learn.adafruit.com/cooperative-multitasking-in-circuitpython-with-asyncio.md)
- [Touch Tone Phone Dial-a-Song](https://learn.adafruit.com/touch-tone-phone-dial-a-song.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Blahaj Alarm and Lamp](https://learn.adafruit.com/blahaj-alarm.md)
- [Program RP2040 in Arduino](https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core.md)
- [Customizing USB Devices in CircuitPython](https://learn.adafruit.com/customizing-usb-devices-in-circuitpython.md)
- [4x4 Rotary Encoder MIDI Messenger](https://learn.adafruit.com/4x4-rotary-encoder-midi-messenger.md)
- [Walkmp3rson: Personal MP3 'Tape' Player](https://learn.adafruit.com/walkmp3rson-personal-mp3-tape-player.md)
- [Mini GIF Players](https://learn.adafruit.com/mini-gif-players.md)
