I'm new to Arduino... and I need some help. I'm sorry if someone else posted this question already but... here it goes:
I am trying to use two CD4510 IC's which in turn drive two 7 segment digits.
The problem I have: how do I set a counter which counts from 1 to 99 and transform that in binary and then output to pins 2-9.
I think it would be easy to use Arrays but I have no idea how to output an array of values...
I thot about doing something like:
Pins[]={2,3,4,5,6,7,8,9}
and then output something like:
[LOW, HIGH,...,LOW, LOW]
Therefore I'm stuck. Any help will be appreciated.
Ups... my first post and a wrong one... :-[ I am using a CD4511... sorry.. I was loking at a 4510/4511 schematic I had around...
I forgot to mention... I already hooked up the two 7 Segment LED display to the IC's and the arduino. If I put a code like:
int ledPin2 = 2;
int ledPin3 = 3;
int ledPin4 = 4;
int ledPin5 = 5;
int ledPin6 = 6;
int ledPin7 = 7;
int ledPin8 = 8;
int ledPin9 = 9;
void setup()
{
pinMode(ledPin2, OUTPUT); Â Â Â
pinMode(ledPin3, OUTPUT); Â Â Â
pinMode(ledPin4, OUTPUT); Â Â
pinMode(ledPin5, OUTPUT); Â Â
pinMode(ledPin6, OUTPUT); Â Â Â
pinMode(ledPin7, OUTPUT); Â Â
pinMode(ledPin8, OUTPUT); Â Â
pinMode(ledPin9, OUTPUT); Â
}
void loop()
{
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, HIGH);
digitalWrite(ledPin5, LOW);
digitalWrite(ledPin6, HIGH);
digitalWrite(ledPin7, LOW);
digitalWrite(ledPin8, HIGH);
digitalWrite(ledPin9, HIGH);
Â
}
I can output the desired value... but it's static. What I am trying to do is make some binary counter.
I have 2 CD4511's and two 7segment digits... therefore the 8 pins...
As for the purpose of this... i want to make temp measurements and display them. Since I have no LCD at disposal I figured I could use the 7 segment display I already had. But using 14 pins instead of 8 ... made me think I could use the 4511(got it right now ) to reduce the number of pins necessary.
I connected the two 4511's to pins 2 to 9. And each of the 4511's have a 7 segment display connected, thus I have a 2 digit number available. As a simple, static value, i managed to make this work. But I would like to change the value as the program runs, e.g.: i measure a temp or a voltage on pin A0 and then output to the display.