Ogu Reginald
Full Member level 6
- Joined
- Oct 7, 2011
- Messages
- 369
- Helped
- 47
- Reputation
- 94
- Reaction score
- 46
- Trophy points
- 1,308
- Location
- Nigeria
- Activity points
- 3,391
Can someone help me and explain the source code below, also point out where there is error and correct them for me. The program is to take input from pin0 of port 1 and on a load at pin1 of port1.
Also help me calculate how long the delay function will stay.
I am using AT89S52 microcontroller.
#include<reg52.h>
sbit LED =P1^1
sbit switch =P1^1
int i;
void delay (void)
{
for(i=0;i<100;i++)
}
Void main
{
while (1)
{
switch=1;
{
if(switch=1)
Delay();
LED=1
}
}
}
- - - Updated - - -
If there are good programming books please give me.
Also help me calculate how long the delay function will stay.
I am using AT89S52 microcontroller.
#include<reg52.h>
sbit LED =P1^1
sbit switch =P1^1
int i;
void delay (void)
{
for(i=0;i<100;i++)
}
Void main
{
while (1)
{
switch=1;
{
if(switch=1)
Delay();
LED=1
}
}
}
- - - Updated - - -
If there are good programming books please give me.