Project-1, Binary Counting

Project-1, Binary Counting

Using LEDs as Binary No. and 2 button switches to add or subtract 1 point per push.

  • 3,877 views
  • 1 comment
  • 14 respects

Components and supplies

About this project

binary numbers is a form of digits using 1 and 0. Their combination brings a natural number. for eg. binary number 101 is 5, 1101 is 13 and 11100 is 28 on which computer field depends upon. I tried to make it to startup in this open field.

It uses 6 LEDs to use on the positions of values 32,16,8,4,2,1 respectively (eg. - 000101 is 5) HERE IS VIDEO TO DEMONSTRATE IT'S WORKING.

THINGS YOU NEED TO HAVE:-

initiate following steps from photos to build it(for more reference see circuit diagram).

Code

codeArduino
It's temporary, only for use, it will not work if something goes incorrect
int l[]={0,0,0,0,0,0},T=6,a,p;
const int b1=12,b2=13;
void setup() {
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(b1,INPUT);
pinMode(b2,INPUT);
}
void loop() {
p=0;
p=digitalRead(b1) ;
while(digitalRead(b1)!=0)
{
  
}
delay(100);
a=T-1;
while(a>=0&&p==1)
{
  if(l[a]==1)
  {
    l[a]=0;
    a--;
  }
  else
  {
    l[a]=1;
    p=0;
  }
}
p=digitalRead(b2) ;
while(digitalRead(b2)!=0)
{
  
}
delay(100);
a=T-1;
while(a>=0&&p==1)
{
  if(l[a]==0)
  {
    l[a]=1;
    a--;
  }
  else
  {
    l[a]=0;
    p=0;
  }
}
a=T-1;
for(int c=0;c<T;c++)
{
    if(l[c]==1)
    digitalWrite(T-c+1,HIGH);
  else
    digitalWrite(T-c+1,LOW);
  a--;
}
}

Schematics

Circuit Diagram
I tried to make it as presentable as its originally made in. Except resistors, because I didn't had correct values of resistors. Make sure you use 10 ohm resistors
project-1.fzz

Comments

Similar projects you might like

3-Bit Binary Calculator Using Arduino Uno

Project showcase by 22warehamD

  • 3,240 views
  • 8 comments
  • 12 respects

Binary Wristwatch

Project showcase by thallia

  • 977 views
  • 0 comments
  • 9 respects

Arduino Based Binary Clock

Project in progress by El Condor

  • 3,053 views
  • 2 comments
  • 15 respects

Buzzer Alarm System With Help Of Arduino

by Team ONYX

  • 37,920 views
  • 5 comments
  • 21 respects

LED Dice

Project showcase by EvdS

  • 14,282 views
  • 11 comments
  • 49 respects

Amazing Binary Clock using LED Matrix Module

Project tutorial by LAGSILVA

  • 9,351 views
  • 10 comments
  • 50 respects
Add projectSign up / Login