then you can go with the following approch
use BCD to 7 segment converter, so that only 4 bits can be used to control a single 7 seven segment display..... so in total u need 12 output lines. you can get 12 output bits by using 2 different ports of any suitable 8 bit microcontroller. link to one such converter http://www.ee.washington.edu/stores/Dat
use 7 bits from one port for all 3 displays and use 3 other bits to select led's this is done very fast so human eye can not make out that the displays are glowing sequencially and not continously.
here is sample code for pic
#include
#include
void DisplayNumber( unsigned int number );
void main()
{
trisb = 0;
trisa = 0xFF;
unsigned int randNumb = 0;
while( 1 )
{
while( porta.0 == 0 ) // wait for key pressed
DisplayNumber( randNumb ); // display number to keep display refreshed
// while key pressed increment counter
// Number will be random based on how long input is turned on
while( porta.0 == 1 )
{
randNumb++;
if( ++randNumb > 9999 )
randNumb = 0;
}
// display a series of random numbers so it looks like we are
char j;
for( j = 0; j < x =" rand();" i =" 0;" i =" 0x01;" i =" 0b1000;">>= 1 )
{
digit = number % 10;
number /= 10;
portb = digit & 0x0F;
portb = (digit & 0x0F) | (i <<>
1 comment:
Socket Class and ServerSocket Class
Specular Reflection
Types of thread
Thread modes
Testing Object-Oriented Applications
Operating System
.Net Technology
What is Symbol Table
Post a Comment