I bought this display for $6 ,
http://www.canton-electronics.com/arduino-6-digit-7-seg-spi-lcd-led-display-module-with-uno-mega2560-example-code-p-717.html
The above page has a code example (attached Notepad fie).
The document [DOWNLOAD] button is a dead link but the ["Arduino Sample Code] button right below it
is the real download link for a ".rar" file (also attached) that contains the HT1621 datasheet PDF two photos
and an IDE program file with a file name that ends with "_ino.ino" (like we wouldn't know it's an ".ino"
file if they didn't put the "_ino" in front of it. Really ?) Anyway, there's two schematics , one of the HT1621
controller with the 4-bit outputs (COM0-COM3) on pins 21-24 and the other schematic is labeled LCD
with COM0-COM3 on pins 21-24. What puzzles me is why BOTH of these show the segments connected.
I can only conclude that the one labeled "LCD" represents the whole circuit with the segments and controller
combined, except for the fact that it doesn't include the YwRobot backpack (photo attached) with the
SPI pins. I was unable to figure out how to control it (display a 6 digit integer) so I copied some code
(attached)
from a Tronix tutorial (chapter-34) on a FOUR digit SPI 7-SEGMENT display (photo on this page:
but it's a Sparkfun and totally different and doesn't use (that I can tell) the HT1621 controller so the code
doesn't look like it would be relevant.
Can anyone tell me what the syntax is to display a 6-digit number ?
I found this part in the code :
void displaydata(unsigned long int t,int p,char bat1,char bat2,char bat3)
{uchar i;
dispnum[5]=num[t/100000];
dispnum[4]=num[(t/10000)%10];
dispnum[3]=num[(t/1000)%10];
dispnum[2]=num[(t/100)%10];
dispnum[1]=num[(t/10)%10];
dispnum[0]=num[t%10];
switch(p)
{case 1:
sbi(dispnum[0], 7);
break;
case 2:
sbi(dispnum[1], 7);
break;
case 3:
sbi(dispnum[2], 7);
break;
default:break;
}
if(bat1==1) sbi(dispnum[3], 7);
if(bat2==1) sbi(dispnum[4], 7);
if(bat3==1) sbi(dispnum[5], 7);
for(i=0;i < 6 ;i++)
{
Write_1621(i*2,dispnum[i]);
}
but I'm puzzled by THIS part:
displaydata(unsigned long int t,int p,char bat1,char bat2,char bat3)
In the example program in the zip file there is an explanation that "bat1, bat2 etc.." refers to RIGHT side of batter (input
connector). What puzzles me is that there are only 3, and it is a 6 digit display. Where's the "other" 3 ? (presumably
"bat4,bat5,bat6".
So am I confused or what ?
4-DIGIT SPI 7-SEGMENT DISPLAY SOURCE CODE EXAMPLE.txt (3.03 KB)
6 DIGIT 7SEG LCD.rar (225 KB)