main.c

来自「MCU控制继电器做的电源老化测试程序.每次测100次」· C语言 代码 · 共 51 行

C
51
字号
//EJK601_TEST prj 
//V1.0 release 2006.12.30
// 
//
//
#include <iom8v.h>
#include <define.h>




void main(void)
{
unsigned char i=0;

DELAY_10MS(10);//(2)
//-------------------INIT PORT---------------------

DDRB=0XFF;     //DDFINE PB OUTPUT
PORTB=0xFF;          //

DDRC=0XFF;      //DDFINE PC OUTPUT
PORTC=0xFF;     //

DDRD=0X00;      //PD0.....PD3  INPUT,PD4....PD7 OUPUT
PORTD=0x00;    
//-------------------INIT PORT---------------------
TV_POWER_ON();
DELAY_1S(4);  // power on delay times

while(i<10)
		{
i++;
DELAY_1S(4);  // power on delay times
if((PIND&0x08)==0x08)
{
DELAY_1S(1);   // backlight on delay times
TV_POWER_OFF();
DELAY_10MS(2);   // power off delay times
}
else
{
TV_POWER_OFF();
PORTB=0;
break;
}
TV_POWER_ON();
				
		}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?