em muốn cho led tắt sau 1 thời gian bật thì làm sao ạ
em đặt giờ cho led sáng xong nó sáng mãi mà ko tắt ấy ạ
#include <main.h>
int16 Dem=0;
int8 Giay=0;
//-----------------------------------------------------------------------------
char Option=0;
//-----------------------------------------------------------------------------
//!void _HienThi(unsigned char Chuoi[]);
//-----------------------------------------------------------------------------
#INT_EXT
void _NgatNgoai(void)
{
Option=Option+1;
if(Option>3)
{
Option=0;
}
delay_ms(200);
}
//--------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void main()
{
//khai bao bien cuc bo o day
unsigned char* pTimeArray;
//! unsigned char* pDateArray;
signed char Gio=22,Phut=5,Giay=10;
lcd_init();
lcd_putc('\f');
enable_interrupts(INT_EXT);
enable_interrupts(INT_EXT_H2L);
enable_interrupts(GLOBAL);
output_bit(LED_DON,0);
while(1)
{
lcd_clear();
while(Option==0)
{
pTimeArray = Get_DS1307_RTC_Time();
lcd_line_1();
printf(lcd_putc,"%02d:%02d:%02d",pTimeArray[2],pTimeArray[1],pTimeArray[0]);
//! switch(pTimeArray[3])
//! {
//! case AM_Time: printf(lcd_putc,"AM"); break;
//! case PM_Time: printf(lcd_putc,"PM"); break;
//! default: lcd_putc('H'); break;
//! }
lcd_line_2();
printf(lcd_putc,"H.GIO:%02d:%02d:%02d",Gio,Phut,Giay);
if(pTimeArray[2]==Gio && pTimeArray[1]==Phut && pTimeArray[0]==Giay)
{
output_bit(LED_DON,1);
}
//! else
//! {
//! output_bit(LED_DON,1);
//! }
//! pDateArray = Get_DS1307_RTC_Date();
//! lcd_gotoxy(1,2);
//! printf(lcd_putc,"%02d-%02d-%02d ",pDateArray[1],pDateArray[2],pDateArray[3]);
//! switch(pDateArray[0])
//! {
//! case Monday: printf(lcd_putc,"MON"); break;
//! case Tuesday: printf(lcd_putc,"TUE"); break;
//! case Wednesday: printf(lcd_putc,"WED"); break;
//! case Thursday: printf(lcd_putc,"THU"); break;
//! case Friday: printf(lcd_putc,"FRI"); break;
//! case Saturday: printf(lcd_putc,"SAT"); break;
//! case Sunday: printf(lcd_putc,"SUN"); break;
//! default: printf(lcd_putc,"???"); break;
//! }
delay_ms(200);//chong giat man hinh
}