Skip to content

cambay/binary_counter_arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This project is a 4-bit binary counter implemented using an Arduino. It uses LEDs to display the binary representation of numbers from 0 to 15. A push button increments the count, a reset button clears all LEDs and resets the count.

Requirements

  • Arduino IDE version 1.8.x or higher
  • Arduino Nano Every (or Arduino Uno for simulation in TinkerCAD)
  • Breadboard and jumper wires
  • 4 LEDs
  • 4 Resistors (220Ω each for LEDs)
  • 2 Push buttons

Features

  • Displays numbers 0-15 in binary using 4 LEDs
  • Increment button to step through the count
  • Reset button to clear the count and turn off all LEDs
  • Uses internal pull-up resistors to simplify wiring

Circuit Diagram

A schematic is included done via TinkerCAD, showing:

  • LEDs connected to digital pins (TinkerCAD only has Arduino UNO, so the pins will be different than Nano/Nano Every)
  • Buttons connected to pins with INPUT_PULLUP mode

Code Explanation:

  • updateLEDs(): Updates LEDs to represent the current binary count
  • ledsOFF(): Turns off all LEDs and resets the count
  • binaryCounter(): Increments count when the button is pressed
  • resetCounter(): Resets count when the reset button is pressed

How to Run

  1. Connect components as per the schematic/Reference photos.
  2. Upload the provided code to your Arduino.
  3. Press the increment button to count up in binary.
  4. Press the reset button to reset the count.

License

This project uses the MIT License and is open-source and free to use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages