Well you know good code when you borrow it, http://www.picbasic.co.uk/forum/showthread.php?t=9037
Now do something with it! Take it apart and see what makes it work.
Code:
shiftout SDO,SCLK,0,[DIGIT_1\8,DIGIT_2\8,DIGIT_3\8,DIGIT_4\8]
there is the statement sending info to the display, SDO & SCK are aliases to ports on the PIC.
DIGIT_1 DIGIT_2 . . . ARE the variable names containing the information, everything else is just counting and sorting the information. You say and I
i want to write a programe to count or digital clock i use 4 digit leds and ic 74hc164
This is not written to work that way, this is written to use SPI style readouts. Go back to that other thread and look at post 6 mister_e's code you will see how to strobe the displays . . . . here is the basic idea, your pic creates a pattern of a number across the output port, and lights 1 display, then repeats with a pattern for the next number and lights it . . . . and it does it so fast you cannot see the dark times.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks