?? 1602shizhong.c
字號:
/*----------------------------------------------------
主函數
編譯器:GCC-AVR 日期: 2008-11-30 19:17:57
目標芯片 : M16
時鐘: 8.0000Mhz
作者:Amas (參考archeng504)
---------------------------------------------------*/
volatile char j=0;
volatile char data[7]={59,59,23,29,2,8,0}; //秒、分、時、日、月、年 、星期選擇
#define F_CPU 10000
#include "LCD.h"
#include"avr/io.h"
#include"LCD_init.h"
#include"avr/interrupt.h"
#include"avr/signal.h"
#include"time.h"
SIGNAL(SIG_OVERFLOW1) //溢出中斷
{
TCNT1H=0x3c; // 重裝載
TCNT1L=0xb0;
j++;
}
void initialize_timer(void) //設置中斷類型,并開中斷
{
TCNT1H=0x3c;
TCNT1L=0xb0;
// TCCR1A=0x00;
TCCR1B=0X01;
TIMSK=0X04;
sei();
}
/*void init_devices(void)
{
CLI(); //disable all interrupts
LCD_init();
MCUCR = 0x00;
GICR = 0x00;
TIMSK = 0x00; //timer interrupt sources
SEI(); //re-enable interrupts
}========*/
int main(void)
{
// init_devices();
initialize_timer();
LCD_init();
for(;;)
{
LCD_time(data[2],data[1],data[0],data[3],data[4],data[5],data[6]);
time_change();
set_time();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -