This Arduino project implements an 8-bit binary counter using LEDs to display the binary representation of a decimal count from 0 to 255.
This project creates a simple binary counter using Arduino, where eight LEDs represent the eight bits of the binary number. As the count increases from 0 to 255, the LEDs will display the corresponding binary value.
To build this project, you will need the following components:
- 1 Arduino board (e.g., Arduino Uno)
- 8 LEDs
- 8 current-limiting resistors (usually 220-330 Ohms)
- Jumper wires
The Arduino sketch (binary_counter.ino
) provided in this repository is responsible for counting from 0 to 255 in binary and controlling the LEDs accordingly. The main parts of the sketch include:
- Initializing the LED pins in the
setup()
function. - Counting and converting the decimal number to binary using the
toBinary()
function. - Updating the LED states in the
loop()
function.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/8-bit-binary-counter.git
-
Install the LEDs according to the wiring diagram above.
-
Connect the Arduino to your machine and upload the code.
-
You can start the count from left to right or right to left depending on the
lightarr[]
elements position.
This project is licensed under the MIT License - see the LICENSE file for details.