#include<AT89X52.h>
#include<stdio.h>
sbit led= p1^5;
void T0M1delay();
void main()
{
unsigned int j;
int c;
c++;
for(j=0;j<250;j++)
{
led=1;
T0M1delay();
}
if (c> 16)
{
led=0;}
}
void T0M1 delay()
{
TMOD&=0xF0;
TMOD|=0x10;
TH0=0XED;
TL0=0XFF;
IE=0;
TF=0;
if(TF==0)
TR=0;}
---------- Post added at 19:57 ---------- Previous post was at 19:43 ----------
in the above program i tested with a led and i was not able to generate 5 sec delay and after 16 counts it has to be stopped but i did not get same result so please help me with the coding.
---------- Post added at 20:05 ---------- Previous post was at 19:57 ----------
please help me with above coding.
---------- Post added at 20:13 ---------- Previous post was at 20:05 ----------
please help me with above coding.
---------- Post added at 20:16 ---------- Previous post was at 20:13 ----------
please help me with above coding.