Hi,
using this code to display 0.00 using 5X TPIC6B595 shift registers -hooked up to 5X 9V 7 seg display units. The code works fine. the display shows up. however - the leftmost "0." is duller than the one in the middle, and the middle duller than the rightmost . I am using common anode displays. I have 12V going to common anode pin. I have correct resistors going to each sink to give me a perfect 20ma for each segment. Is the only way to get these segments the same brightness to multiplex?
Ive attached the datasheets- and also a diagram of my setup (which isnt mine - it just shows only three displays and i'm using 5 - also ignore the 15V and the resistor values)
//======================================CONSTANTS++++++++++++++++++++++++++++++++++++++++++
const byte numTable[] =
{
B11111100, //numeral 0
B01100000, //numeral 1
B11011010, //numeral 2
B11110010, //numeral 3
B01100110, //numeral 4
B10110110, //numeral 5
B10111110, //numeral 6
B11100000, //numeral 7
B11111110, //numeral 8
B11110110 //numeral 9
};
const int _7segCLK = 13; //Connected to TPIC pin 13: SRCLK (aka Clock)
const int _7segLATCH = 10; //Connected to TPIC pin 12: RCLK (aka Latch/load/CS/SS...)
const int _7segOE = 9; //Connected to TPIC pin 9: OE (Output Enable)
const int _7segDOUT = 11; //Connected to TPIC pin 3: SER (aka MOSI)
//======================================VARIABLES++++++++++++++++++++++++++++++
int x=1;
void setup(){
pinMode(_7segCLK,OUTPUT);
pinMode(_7segLATCH,OUTPUT);
pinMode(_7segDOUT, OUTPUT);
pinMode(_7segOE, OUTPUT);
clear_7segA();
}
//======================================
void loop(){
if (x==1){
sendZeroes7seg(); //sends "0.00" to 7 seg display
x+=1;
}
}
//======================================
void sendZeroes7seg(){ //sends "0.00" to 7 seg display
digitalWrite(_7segLATCH,LOW); //Tells all SRs that uController is sending data
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,numTable[0]);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,numTable[0]);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,B11111101); //numeral 0 with dp
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0); //blank
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0); //blank
digitalWrite(_7segLATCH,HIGH);
}
//========================================
void clear_7segA(){
//clears the display
digitalWrite(_7segOE,LOW);
digitalWrite(_7segLATCH,LOW);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0);
shiftOut(_7segDOUT,_7segCLK,LSBFIRST,0);
digitalWrite(_7segLATCH,HIGH);
}
//========================================
red 7 seg kingsbright.pdf (120 KB)