Skip to content

alexandr3i/Calculator-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Calculator (Arduino)

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.


What’s in this repository

  • final_code.ino - Arduino code
  • Calculator – Arduino Project.pptx - project presentation

Wiring (pin map used in the code)

Rotary encoder

  • CLK -> D10
  • DT -> D9
  • SW -> D8 (button uses INPUT_PULLUP)

Keypad (4x4)

  • 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 / =

LCD (I2C)

  • 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).


How to run it

  1. Install Arduino IDE.
  2. Install required libraries (Arduino Library Manager):
    • Keypad (for the 4x4 keypad)
    • LiquidCrystal_I2C (for the I2C LCD)
  3. Open final_code.ino in Arduino IDE.
  4. Select your board and port (Tools → Board / Port).
  5. Upload.

How to use the calculator

  • 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

License

Educational use only. This repository is intended for learning, demonstration, and portfolio/documentation purposes.

About

Building a calculator using an Arduino, which does basic calculations, including addition, subtraction, multiplication, division with whole and decimal numbers. All the calculations follow the order of operations rule: multiplication and division first, then addition and subtraction.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages