Microcontroller › 8051 › 8051 based problem › #include
December 25, 2013 at 6:26 am
#10757
balaji
Participant
#include<reg51.h>
sbit sw=P1^0;
//unsigned char *call_cmd =”ATD9843927672;”;
unsigned char b[]={‘A’,’T’,’D’,’8′,’8′,’4′,’3′,’9′,’2′,’7′,’6′,’7′,’2′,};
unsigned char i;
void delay(unsigned char z)
{
unsigned int i,j;
for(i=0;i<z;i++)
for(j=0;j<1275;j++);
}
void trans(unsigned val)
{
SBUF=val;
while(TI==0);
TI=0;
}
void main()
{
P1=0xff;
SCON=0X52;
TMOD=0X20;
TH1=0XFD;
TR1=1;
TI=1;
sw=0;
while(1)
{
if(sw==0)
{
for(i=0;i<14;i++)
{
trans(b);
delay(50);
}
}
}
}