Seven Segment Display to Arduino in Proteus – Arduino Proteus Simulation tutorial # 16
|Seven Segment Display to Arduino in Proteus – Arduino Proteus Simulation tutorial # 16
Arduino Robotic Online Individual Classes (via skype) with Practical Explanations, Contact me on: nik261190@gmail.com
Connecting a 7 Segment Display to Arduino, Coding, and Simulating. Step by Step guiding tutorial. 😀
Seven Segment Display to Arduino in Proteus – Arduino Proteus Simulation tutorial # 16
Seven Segment Display to Arduino in Proteus – Arduino Proteus Simulation tutorial # 16
13 Comments
The Code to upload to arduino:
void setup() {
// put your setup code here, to run once:
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
zero();
one();
two();
three();
four();
five();
six();
seven();
eight();
nine();
}
void zero() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
delay(1000);
}
void one(){
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,LOW);
delay(1000);
}
void two() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(1000);
}
void three() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(1000);
}
void four() {
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void five() {
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void six() {
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void seven() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,LOW);
delay(1000);
}
void eight() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void nine() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
sir if manual counting up and dow with switch how to do.
please send code automatic toilet cleaning system using arduino
what about 2 digit display?
sir two 7 segment per same no show karne ke liye kase program bnaye please help
good…..supa@
your code helped me alot. tried to do a little modification. this code uses a reset routine and enables just specific pins for specific number.
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
void setup() {
pinMode(pin3,OUTPUT);
pinMode(pin4,OUTPUT);
pinMode(pin5,OUTPUT);
pinMode(pin6,OUTPUT);
pinMode(pin7,OUTPUT);
pinMode(pin8,OUTPUT);
pinMode(pin9,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
zero();
delay (100);
resetFunc();
one();
delay(100);
resetFunc();
two();
delay (100);
resetFunc();
three();
delay(100);
resetFunc();
four();
delay (100);
resetFunc();
five();
delay (100);
resetFunc();
six();
delay(100);
resetFunc();
seven();
delay (100);
resetFunc();
eight();
delay (100);
resetFunc();
nine();
delay (100);
resetFunc();
}
void zero()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin6,HIGH);
digitalWrite(pin5,HIGH);
digitalWrite(pin4,HIGH);
}
void one()
{
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
}
void two()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin3,HIGH);
digitalWrite(pin5,HIGH);
digitalWrite(pin6,HIGH);
}
void three()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin6,HIGH);
digitalWrite(pin3,HIGH);
}
void four()
{
digitalWrite(pin3,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin4,HIGH);
}
void five()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin3,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin6,HIGH);
digitalWrite(pin4,HIGH);
}
void six()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin3,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin6,HIGH);
digitalWrite(pin5,HIGH);
digitalWrite(pin4,HIGH);
}
void seven ()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
}
void eight()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin6,HIGH);
digitalWrite(pin5,HIGH);
digitalWrite(pin4,HIGH);
digitalWrite(pin3,HIGH);
}
void nine()
{
digitalWrite(pin9,HIGH);
digitalWrite(pin8,HIGH);
digitalWrite(pin7,HIGH);
digitalWrite(pin3,HIGH);
digitalWrite(pin4,HIGH);
}
void resetFunc()
{
digitalWrite(pin9,LOW);
digitalWrite(pin8,LOW);
digitalWrite(pin7,LOW);
digitalWrite(pin6,LOW);
digitalWrite(pin5,LOW);
digitalWrite(pin4,LOW);
digitalWrite(pin3,LOW);
}
is this software useless? i can run a led with 500V and it works :O
When i tried to upload the program in arduino card ,i failed because everytime i find the folder where i saved the program is empty. Can you help me?
how to 2 digit 7 segmen counter down button
99-0?
THANKS 🙂
i need the code, can you give?
I found your video helpful but when I simulate it with 7seg display, I received error "cannotfind 7segcomk.mdf" model. Same in case of led.