First of all this concept is used in teaching of mute students and next it can be used in hospital to explain various requirements wirelessly using Bluetooth. It will display everything on the computer screen.
#include<reg51.h>
sbit ALE=P1^4;
sbit SOC=P1^0;
sbit OE=P1^2;
sbit EOC=P1^1;
sbit SET0=P1^5;
sbit SET1=P1^6;
sbit SET2=P1^7;
sbit CLOCK=P1^3;
void tx(unsigned char num)
{
SBUF = num;
while(TI == 0);
TI = 0;
}
void clock_adc()
{
unsigned int b;
for(b=0;b<=5000;b++)
CLOCK=~CLOCK;
}
void delay()
{
unsigned int z;
for(z=0;z<8000;z++);
}
void main()
{
unsigned char first_finger,second_finger,third_finger,fourth_finger,thumb;
SCON=0x50;
TMOD=0x20;
TH1=0xfd;
TR1=1;
SOC=0;
OE=0;
EOC=1;
while(1)
{
tx('A');
delay();
SET2=0;SET1=1; SET0=1; //for the select line
ALE=1; SOC=1;
clock_adc();
SOC=0; ALE=0;
clock_adc();
while(EOC==0);
OE=1;
first_finger=P2;
tx(((first_finger/100)%10)+0x30);
delay();
tx(((first_finger/10)%10)+0x30);
delay();
tx((first_finger%10)+0x30);
delay();
SET2=0;SET1=1; SET0=0; //for the select line
ALE=1; SOC=1;
clock_adc();
SOC=0; ALE=0;
clock_adc();
while(EOC==0);
OE=1;
second_finger=P2;
tx(((second_finger/100)%10)+0x30);
delay();
tx(((second_finger/10)%10)+0x30);
delay();
tx((second_finger%10)+0x30);
delay();
SET2=0;SET1=0; SET0=1; //for the select line
ALE=1; SOC=1;
clock_adc();
SOC=0; ALE=0;
clock_adc();
while(EOC==0);
OE=1;
third_finger=P2;
tx(((third_finger/100)%10)+0x30);
delay();
tx(((third_finger/10)%10)+0x30);
delay();
tx((third_finger%10)+0x30);
delay();
SET2=0;SET1=0; SET0=0; //for the select line
ALE=1; SOC=1;
clock_adc();
SOC=0; ALE=0;
clock_adc();
while(EOC==0);
OE=1;
fourth_finger=P2;
tx(((fourth_finger/100)%10)+0x30);
delay();
tx(((fourth_finger/10)%10)+0x30);
delay();
tx((fourth_finger%10)+0x30);
delay();
SET2=1;SET1=0; SET0=0; //for the select line
ALE=1; SOC=1;
clock_adc();
SOC=0; ALE=0;
clock_adc();
while(EOC==0);
OE=1;
thumb=P2;
tx(((thumb/100)%10)+0x30);
delay();
tx(((thumb/10)%10)+0x30);
delay();
tx((thumb%10)+0x30);
delay();
}
}
Comments