How can I display different numbers in a dual 7 segment with arduino and proteus?
This is my setup:
void setup() {
pinMode(13,OUTPUT); //a
pinMode(12,OUTPUT); //b
pinMode(11,OUTPUT); //c
pinMode(10,OUTPUT); //d
pinMode(9,OUTPUT); //e
pinMode(8,OUTPUT); //f
pinMode(7,OUTPUT); //g
pinMode(6,OUTPUT); //power 1 (left)
pinMode(5,OUTPUT); //power 2 (left)
}
I use this code (in void loop) to display the number 0 in the 7 segment:
digitalWrite(6, 0); //power 1 (left)
digitalWrite(5, 0); //power 2 (left)
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, HIGH);
digitalWrite(9, HIGH);
digitalWrite(8, HIGH);
digitalWrite(7, LOW);
If I simulate this in proteus I got this output:
If I add another number like 8:
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, HIGH);
digitalWrite(9, HIGH);
digitalWrite(8, HIGH);
digitalWrite(7, HIGH);
The code will just go 0 and 8 on both of the 7segments.
I want it to display 0 on the right and eight on the left but I dont know how to control this dual 7 segment. I want to create a countdown timer, and I have not found any tutorials about it, the tutorials were 2 7 segments in the countdown, not a dual 7 segment display.
Note: I am not using any registers in this project.