# Project-1, Binary Counting

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

• 7,573 views
• 22 respects

## Components and supplies

 Arduino UNO
×1
×1
 Male/Male Jumper Wires
×12
 LED (generic)
×6
 SparkFun Pushbutton switch 12mm
×2
 10 ohm resistor
×2

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;
{

}
delay(100);
a=T-1;
while(a>=0&&p==1)
{
if(l[a]==1)
{
l[a]=0;
a--;
}
else
{
l[a]=1;
p=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

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

• 1 project
• 1 follower

June 27, 2016

#### Members who respect this project

and 18 others

See similar projects
you might like

#### 3-Bit Binary Calculator Using Arduino Uno

Project showcase by 22warehamD

• 10,228 views
• 16 respects

#### Binary Wristwatch

Project showcase by thallia

• 2,942 views
• 12 respects

#### Breadboard to PCB Part 1 - Making the Simon Says Game

Project tutorial by Katie Kristoff and Monica Houston

• 14,799 views
• 34 respects

#### Arduino Based Binary Clock

Project in progress by El Condor

• 5,411 views
• 17 respects

#### DIY IR Remote and IR Remote controlled LEDs

Project tutorial by Rucksikaa Raajkumar

• 3,198 views