This example uses PBP, but the superb write-up will give you an idea of how its done anyway. http://www.melabs.com/resources/articles/ledart.htm Regards, Anand Dhuru ----- Original Message ----- From: "Dave VanHorn" To: Sent: Saturday, May 03, 2003 9:18 PM Subject: Re: [PIC] Source Code for seven segment display > At 11:33 AM 5/3/2003 -0400, John Nall wrote: > >Would anyone be willing to share a bit of source code with me, for driving > >three seven segment displays? > > One easy way to do this, is to use a lookup table. > Take the digit you want to display, if needed, convert it to binary 0-F > Using this value, index into a table that will return the proper bits set > as "1" to turn on the appropriate segments of the display. > Since there are seven segments, you can use just one byte. > In the PIC, this is something like a jump to an address plus an offset (the > index value) and the table consists of RETLW instructions that are a return > from subroutine, with the W register loaded with some value > > Seg_Table: > retlw 0x11111110 > retlw 0x00000110 > etc > > or something like that anyway. :) > I'm the resident heretic, I use AVRs > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics