https://github.com/diegograham/calculator
An Arduino-based calculator using a keypad and LCD display to perform basic arithmetic operations with buzzer feedback.
https://github.com/diegograham/calculator
arduino calculator electronics embedded-systems keypad lcd
Last synced: about 1 month ago
JSON representation
An Arduino-based calculator using a keypad and LCD display to perform basic arithmetic operations with buzzer feedback.
- Host: GitHub
- URL: https://github.com/diegograham/calculator
- Owner: diegograham
- Created: 2025-04-23T17:52:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-23T18:09:25.000Z (about 1 year ago)
- Last Synced: 2025-04-23T18:44:41.271Z (about 1 year ago)
- Topics: arduino, calculator, electronics, embedded-systems, keypad, lcd
- Language: C++
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Calculator 2
### By: Diego J. Graham
## Description
**Calculator 2** is an Arduino-based project that uses a membrane keypad for user input and an LCD to display the calculation. The calculator can **add, subtract, multiply, and divide** two integers, and it displays the result as a **float**. It also includes a **buzzer** for audible feedback on button presses.
---
## Features
- Accepts input via a 4x4 membrane keypad.
- Displays real-time input and output on a 16x2 LCD.
- Supports basic operations: `+`, `-`, `*`, and `/`.
- Automatically evaluates the expression when `=` is pressed.
- `C` button clears all inputs.
- Built-in buzzer beeps with every keypress.
- Handles division-by-zero errors gracefully by displaying "ERROR".
---
## How It Works
- The user enters the **first number**.
- The user then presses an **operator** (`+`, `-`, `*`, `/`).
- The user enters the **second number**.
- Pressing `=` evaluates the expression.
- Pressing `C` clears the input and resets the calculator.
---
## Required Libraries
- Keypad - handles keypad input
- liquidCrystal - controls the LCD display
--
## Components Used
- Arduino (MEGA or compatible board)
- 4x4 Membrane Keypad
- 16x2 LCD Display
- Piezo Buzzer
- Jumper Wires
- Breadboard
---
## Schematic
A complete schematic is included in the repository under the filename:
---
## Getting Started
1. Clone the repository.
2. Open `Calculator2.ino` in the Arduino IDE.
3. Connect the components as shown in the schematic.
4. Upload the sketch to your Arduino board.
5. Use the keypad to input and calculate!
---
## Notes
- The result is always displayed as a float (e.g., `4.00`).
- Make sure your keypad wiring matches the `rowPins` and `colPins` defined in the code.
- LCD must be initialized using pins `7, 8, 9, 10, 11, 12`.
---
## Future Improvements
- Add decimal support for more precise inputs.
- Improve input validation (e.g., multiple operators).
- Add support for chained calculations.
---
## License
This project is open source and free to use with credit.
---