hello guys,
after i finally found the library i need please to know if there is any tutorial on this site or else on how to work with it ?
here is a picture of the datasheet in the attachment files
hello guys,
after i finally found the library i need please to know if there is any tutorial on this site or else on how to work with it ?
here is a picture of the datasheet in the attachment files
firashelou:
hello guys,
after i finally found the library i need please to know if there is any tutorial on this site or else on how to work with it ?
If we could find it we might be able to offer some suggestions. Perhaps you could tell us where you found it. We wouldn't want to give you information about a different library by mistake.
Don
floresta:
firashelou:
hello guys,
after i finally found the library i need please to know if there is any tutorial on this site or else on how to work with it ?If we could find it we might be able to offer some suggestions. Perhaps you could tell us where you found it. We wouldn't want to give you information about a different library by mistake.
Don
i found it here on this site someone has shared this link that leads to it :
https://docs.google.com/file/d/0Bwrp4uluZCpNdE9oWTY0M3BncTA/edit
i made my own kind of library, and i found out that the right should be coded before the left, but don't know why it wasn't working before !!
but only the zeroes are working !!
these are the codes
void setup(){
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop(){
//0
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
delay(1000);
//1
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);//pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);//pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
delay(1000);
//0
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
delay(1000);
}
Connect the four digit pins with four limiting resistors in series to any digital or analog pins.
AARRGGHH.
I stopped reading at this point. If he can't get this part right I don't have much confidence in the rest of what he says. The resistors (eight of them) go in series with the segment pins.
Don
Your code cannot be evaluated without knowing what each pin of the Arduino is doing. A simple way of doing this is by adding comments to these statements:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
As far as this part is concerned, whatever you are trying to accomplish in the first half will be immediately overwritten by whatever you are trying to accomplish in the second half.
//0
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
delay(1000);
Don
floresta:
Your code cannot be evaluated without knowing what each pin of the Arduino is doing. A simple way of doing this is by adding comments to these statements:pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
As far as this part is concerned, whatever you are trying to accomplish in the first half will be immediately overwritten by whatever you are trying to accomplish in the second half.
//0
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
delay(1000);Don
yes your right, but i saw in a tutorial or i heard the guy saying we will light up every single digit by it's own which will look like it is lighting in the same time so i tried that then i noticed it can't work, but i need to know how to make it work then ? :S
[quote author=floresta link=topic=176502.msg1310181#msg1310181 date=1373408887]
[color=black]Your code cannot be evaluated without knowing what each pin of the Arduino is doing. A simple way of doing this is by adding comments to these statements:[/color]
[code] pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
about this part well, all the pins of the display are connected to the arduino as u can see in this part of codes[/code]
... but i need to know how to make it work then ?
In order to give you any help here I have to know what you are trying to do.
What does Arduino pin 3 control (what is it connected to)?
What does Arduino pin 4 control (what is it connected to)?
Same question for the rest of the pins ...
What are the ten statements in the first part of ' //0 ' attempting to accomplish?
What are the ten statements in the second part of ' //0 ' attempting to accomplish?
What is the purpose of the delay after the second group of ten statements?
Why is there no delay after the first group of ten statements?
Don
floresta:
... but i need to know how to make it work then ?
In order to give you any help here I have to know what you are trying to do.
What does Arduino pin 3 control (what is it connected to)?
What does Arduino pin 4 control (what is it connected to)?
Same question for the rest of the pins ...
What are the ten statements in the first part of ' //0 ' attempting to accomplish?
What are the ten statements in the second part of ' //0 ' attempting to accomplish?
What is the purpose of the delay after the second group of ten statements?
Why is there no delay after the first group of ten statements?
Don
ok what I am trying to do is counting 00, 01, 00, 01, 00 and so on so the pin number 1 of the display is connected to pin 2 of the arduino and so on till pin 10 or display, I added pictures for the datasheet
ok what I am trying to do is counting 00, 01, 00, 01, 00 and so on
OK. If your //0 and //1 comments had been //00 and //01 we may have been able to figure this out and this would have verified that you were dealing with a two-digit seven-segment display which I suspected when I formulated my questions.
so the pin number 1 of the display is connected to pin 2 of the arduino and so on till pin 10 or display,
But we still don't know what pin number 1 of the display does ... and so on.
I added pictures for the datasheet
I don't see any pictures here. It looks like you may have added them to your earlier posts which accomplishes two things:
(1) It almost guarantees that anyone that has been participating in this thread will overlook them since they do not reread the entire thread each time there is a new post.
(2) It almost guarantees that anyone stumbling on the thread for the first time will have a hard time following the thread because the answers to the earlier posts are based on material that has changed since the answer was written.
Since you have a two digit display you have to understand that you are dealing with multiplexing. This essentially means that only one of the digits is ever on at a given instant in time. So, you should read up on multiplexing, go back and answer each of the questions in my previous post, and then see if you can restructure your program code. I suggest that you initially concentrate on just displaying a single pair of numbers.
Here is an outline of what has to be done (I can't be more specific about the logic levels since I don't know if you have a common anode or a common cathode display):
Set up the logic levels on the common elements to deactivate both digits.
Set up the proper levels for each of the segments of the left hand digit.
Set up the logic levels on the common elements to activate the left hand digit and deactivate the right hand digit.
Delay for a fraction of a second.
Set up the logic levels on the common elements to deactivate both digits.
Set up the proper levels for each of the segments of the right hand digit.
Set up the logic levels on the common elements to activate the right hand digit and deactivate the lefthand digit.
Delay for a fraction of a second.
Repeat
Don
floresta:
ok what I am trying to do is counting 00, 01, 00, 01, 00 and so on
OK. If your //0 and //1 comments had been //00 and //01 we may have been able to figure this out and this would have verified that you were dealing with a two-digit seven-segment display which I suspected when I formulated my questions.
so the pin number 1 of the display is connected to pin 2 of the arduino and so on till pin 10 or display,
But we still don't know what pin number 1 of the display does ... and so on.
I added pictures for the datasheet
I don't see any pictures here. It looks like you may have added them to your earlier posts which accomplishes two things:
(1) It almost guarantees that anyone that has been participating in this thread will overlook them since they do not reread the entire thread each time there is a new post.
(2) It almost guarantees that anyone stumbling on the thread for the first time will have a hard time following the thread because the answers to the earlier posts are based on material that has changed since the answer was written.Since you have a two digit display you have to understand that you are dealing with multiplexing. This essentially means that only one of the digits is ever on at a given instant in time. So, you should read up on multiplexing, go back and answer each of the questions in my previous post, and then see if you can restructure your program code. I suggest that you initially concentrate on just displaying a single pair of numbers.
Here is an outline of what has to be done (I can't be more specific about the logic levels since I don't know if you have a common anode or a common cathode display):
Set up the logic levels on the common elements to deactivate both digits.
Set up the proper levels for each of the segments of the left hand digit.
Set up the logic levels on the common elements to activate the left hand digit and deactivate the right hand digit.
Delay for a fraction of a second.
Set up the logic levels on the common elements to deactivate both digits.
Set up the proper levels for each of the segments of the right hand digit.
Set up the logic levels on the common elements to activate the right hand digit and deactivate the lefthand digit.
Delay for a fraction of a second.
RepeatDon
sorry it's my fault about info i thought i added the "library": well it's a CA display, and about my comments as you can see in the library my comment in the codes down there in the attachement file, and about the list you said i did those steps but i reached a place where when i activate both digits i will have the same number on both, i couldn't figure out how to activate both digits with a different number like 01 02 ... all i had is 0 left or 0 right, 1 left or 1 right etc :
_2_digit_set_up.ino (11.8 KB)
OK - we will do it the hard way. This is going to take a long time.
What is the function of pin 1 on your display?
Don
I don't understand what do you mean which function?
pin1 is connected to pin 2 on arduino and I always turn it off because it's for the point
...pin1 is connected to pin 2 on arduino and I always turn it off because it's for the point
Ah ha - pin 1 of the display is connected to the decimal point.
pinMode(2, OUTPUT); // LED decimal point
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
. . .
and
//0
digitalWrite(2, HIGH); // decimal point OFF
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
. . .
Your turn.
Don
did you checked the pictures of the datasheet i attached at the start of the topic ? and the file i attached for the "library" it's a personal library just to know the numbers like :
//0 Left digit
/*digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW); //pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
*/
//1 Left digit
/*digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);//pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
*/
//2 Left digit
/*digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);//pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
digitalWrite(11, HIGH); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
*/
//3 Left digit
/*digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);//pin 6 of arduino is connected to pin 5 of the display LOW for 1 digit and HIGH with pin 10 for 2 digits
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW); // pin 11 of arduino is connected to pin 10 of the display HIGH for 1 digit
*/
I give up.
Don
floresta:
I give up.Don
dude thanks a lot for all your time i finally solved it
here is the new codes:
void setup(){
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void displayDigit(int digit){
if(digit == 0){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}else if(digit == 1){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}else if(digit == 2){
//2 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
}else if(digit == 3){
//3 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}else if(digit == 4){
//4 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}else if(digit == 5){
//5 Left digit
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
}else if(digit == 6){
//6 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
}else if(digit == 7){
//7 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}else if(digit == 8){
//8 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}else if(digit == 9){
//9 Left digit
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}
}
void loop(){
digitalWrite(6, HIGH);
digitalWrite(11, LOW);
displayDigit(1);
delay(10);
digitalWrite(6, LOW);
digitalWrite(11, HIGH);
displayDigit(5);
delay(10);
}
i finally solved it
Not exactly, as you will most likely discover when you attempt to display data that is changing. At that point you might want to go back and implement all of the steps that I outlined, in the order that I specified.
Don
floresta:
i finally solved it
Not exactly, as you will most likely discover when you attempt to display data that is changing. At that point you might want to go back and implement all of the steps that I outlined, in the order that I specified.
Don
actully yes, when it comes to changing data !! :S