The project implements an interactive binary calculator using Arduino.
This Arduino project implements a binary calculator where users can input an 8-bit number (ranging from 0 to 255) using switches that represent the individual bits. LEDs corresponding to the activated bits light up, and upon pressing a button, the system calculates the decimal equivalent. The result is then sent to another Arduino board, which displays it on a 4-digit display.
See the Online simulation on Tinkercad
The controller script handles the input from the switches, activates LEDs based on the selected bits, and calculates the decimal value when the button is pressed. The calculated result is sent to the display Arduino board.
- Switches: 19, 18, 17, 16, 2, 3, 4, 5
- LEDs: 6, 7, 8, 9, 10, 11, 12, 13
- Button: 14
- TX Pin: 1
- Connect the switches and LEDs as per the specified pin configuration.
- Input an 8-bit number by turning on the corresponding switches.
- Press the button to calculate and send the decimal value to the display Arduino.
The script reads the state of the switches, toggles LEDs based on switch states, and calculates the decimal value using the binary representation.
The display script receives the calculated decimal value from the controller and showcases it on a 4-digit display.
- RX Pin: 0 (Connect to the TX pin of the sender Arduino)
- SDA: connect to HT16K33 display
- SLC: connect to HT16K33 display
- Connect the RX pin to the TX pin of the sender Arduino.
- The display Arduino will receive and showcase the calculated decimal value.
The script listens for incoming data on the serial port, reads the integer value, and displays it on the 4-digit display.
The project is planned to evolve, allowing users to input two numbers and perform calculations such as addition, subtraction, etc.
- Set up the hardware according to the provided pin configuration.
- Upload the controller script to one Arduino board and the display script to another.
- Power on the system and use the switches to input an 8-bit number.
- Press the button to calculate and display the decimal value on the 4-digit display.
Ensure the Adafruit LEDBackpack library is installed for the display script.