Sunteți pe pagina 1din 2

/*******************************************************************************

***************
* FileName:
Main.c
* Processor:
AT89C52
* Complier:
Keil IDE
* Company:
Scientech Technologies Pvt. Ltd.
*
********************************************************************************
****************
* File Description: LED Blinking with NV5001
*
* Steps for Operation
* Step 1:*
Swith ON NV5001
*
Burn Program "LED Blinking.hex" file in 8051/52 Microcontroller us
ing NV5001
*
* Step 2:* Connections:
*
Connect 8 LED with PORT P1
*
* Step 3:*
Place MicroController on ZIF Socket
*
Switch on the Power supply
*
Press Reset Switch
*
* Step 4:* OutPut:
*
ALL 8 LEDs Will Blink Continuously.
*
* Change History:
* Name
Date
Changes
* Rajeev Karothia
20/01/12
Initial Version
********************************************************************************
****************/
#include<regx52.h>
/*******************************************************************************
*****************
*
Output Pins for LED
********************************************************************************
****************/
#define LED0 P1_0
#define LED1 P1_1
#define LED2 P1_2
#define LED3 P1_3
#define LED4 P1_4
#define LED5 P1_5
#define LED6 P1_6
#define LED7 P1_7
/*******************************************************************************
*****************
*
Delay Function
********************************************************************************
****************/
void Delay(unsigned int rTime)
{
unsigned int x,y;
for(x=0;x<rTime;x++)

for(y=0;y<1275;y++);
}
/*******************************************************************************
*****************
*
Main Loop
********************************************************************************
****************/
void main()
{
P1 = 0x00;
/* Define as Output Port
*/
while(1)
{
LED0 = 0;

/* All LED OFF

*/
LED1
LED2
LED3
LED4
LED5
LED6
LED7

=
=
=
=
=
=
=

0;
0;
0;
0;
0;
0;
0;

Delay(100);
LED0 = 1;
*/
LED1
LED2
LED3
LED4
LED5
LED6
LED7

=
=
=
=
=
=
=

1;
1;
1;
1;
1;
1;
1;

Delay(100);
}
}

/* All LED ON

S-ar putea să vă placă și