A calculator built with an Arduino that supports:
- Addition, subtraction, multiplication, division
- Whole and decimal numbers
- Order of operations:
*and/first, then+and-
This repo contains the Arduino sketch and a presentation.
final_code.ino- Arduino codeCalculator – Arduino Project.pptx- project presentation
CLK-> D10DT-> D9SW-> D8 (button usesINPUT_PULLUP)
- Rows -> D0, D1, D2, D3
- Cols -> D4, D5, D6, D7
Key layout in code:
- Row1:
1 2 3 + - Row2:
4 5 6 - - Row3:
7 8 9 . - Row4:
* 0 / =
- Address:
0x27 - Uses I2C pins (SDA/SCL) for your board (Uno: A4/A5)
IMPORTANT: Because the keypad uses D0/D1, you should not rely on Serial Monitor on an Arduino Uno (D0/D1 are the UART pins).
- Install Arduino IDE.
- Install required libraries (Arduino Library Manager):
Keypad(for the 4x4 keypad)LiquidCrystal_I2C(for the I2C LCD)
- Open
final_code.inoin Arduino IDE. - Select your board and port (Tools → Board / Port).
- Upload.
- Type numbers and operators from the keypad (
+ - * /and.for decimals) - Press
=to compute - Use the rotary encoder:
- Rotate to move the cursor left/right
- Press the encoder button to delete at the cursor position
Educational use only. This repository is intended for learning, demonstration, and portfolio/documentation purposes.