Go Down

Topic: 7 Segment connection and code (Read 915 times) previous topic - next topic

zoom

Connected the middle pins both at the up and bottom to ground, a,b,c,d,e,f,g are connected to outputs as well. (didn't use any resistor for a,b,c... but GND)

The code is quite straightforward but didn't work don't know why ? At where am I wrong ?
Quote
int a = 8;
int b = 9;
int c = 10;
int d = 11;
int e = 12;
int f = 13;
int g = 7;

void setup()
{
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(7, OUTPUT);
}
void loop()
{
  digitalWrite(a, LOW);
}

zoom

#1
Feb 09, 2013, 02:06 pm Last Edit: Feb 09, 2013, 02:17 pm by zoom Reason: 1
Okay I've realised one of the problems.

pinMode declarations had to be as follows

pinMode(a, OUTPUT) and goes like that.

However, still nothing happens.

johnwasser

Did you try setting any of the output pins HIGH?

Are you sure your displays are Common Cathode?
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

zoom


Did you try setting any of the output pins HIGH?

Are you sure your displays are Common Cathode?


Yes I've tried both High and low

floresta

Quote
Connected the middle pins both at the up and bottom to ground, ...

Maybe those are not the common pins.  You haven't told us anything about the display so we really can't tell.

Quote
didn't use any resistor for a,b,c... but GND

Adequate for testing, but not a good solution.

Don

Go Up