2021-11-05 09:56:27 索煒達(dá)電子 856
項(xiàng)目編號(hào):E2147
文件大?。?.2M
源碼說(shuō)明:帶中文注釋
開發(fā)環(huán)境:C編譯器
簡(jiǎn)要概述:
嵌入式課程設(shè)計(jì)
基于LPC1768實(shí)驗(yàn)開發(fā)板,設(shè)計(jì)并實(shí)現(xiàn)一個(gè)智能萬(wàn)年歷。
功能說(shuō)明
主頁(yè)
當(dāng)板載開關(guān)開啟后,默認(rèn)進(jìn)入主頁(yè),顯示當(dāng)前月的日歷。并有3個(gè)按鈕:
Curr Month:顯示當(dāng)前月的日歷。
Last Month:顯示上一個(gè)月的日歷。
Next Month:顯示下一個(gè)月的日歷。
主頁(yè)
設(shè)置日期頁(yè)
按左右鍵,可以進(jìn)行年、月、日的選擇;按上下鍵,可以調(diào)整具體的數(shù)值。
設(shè)置日期頁(yè)
設(shè)置時(shí)間頁(yè)
按左右鍵,可以進(jìn)行時(shí)、分、秒的選擇;按上下鍵,可以調(diào)整具體的數(shù)值。
設(shè)置時(shí)間頁(yè)
更多頁(yè)
Night Mode:夜間模式,打開后顯示屏從"白底黑字"變?yōu)?quot;黑底白字"。
Record Date:重要事項(xiàng),點(diǎn)擊后日歷將會(huì)在指定日期做一個(gè)標(biāo)記。
Recover Date:恢復(fù)到上一個(gè)日期設(shè)置。若日期不小心設(shè)置錯(cuò)誤,可以回退。
Factory Reset:時(shí)間置為出廠設(shè)置,方便出錯(cuò)時(shí)一鍵還原。
設(shè)置 夜間模式
設(shè)計(jì)原理
星期計(jì)算
基姆拉爾森公式,可以計(jì)算某年某月某日是星期幾:
W = ( d + 2*m + 3*(m+1)/5 + y + y/4 - y/100 + y/400 + 1 ) % 7
在公式中,W表示星期幾,y表示年,m表示月,d表示日。
注意,該公式有個(gè)與其它公式不同的地方:要把1月和2月看成是上一年的13月和13月,如:2004年1月10日轉(zhuǎn)換成2003年13月10日代入計(jì)算。
全局變量表
由于程序有多個(gè)頁(yè)面,為使得函數(shù)之間能夠相互"通信",需要用到多個(gè)全局變量。
用戶函數(shù)表
流程圖
效果圖
目錄│文件列表:
└ SoC
├ BSP
│ ├ include
│ │ │ bmboard.h
│ │ │ fonts_16x24.h
│ │ │ fonts_5x7.h
│ │ │ joystick.h
│ │ │ key.h
│ │ │ LCD.h
│ │ │ led.h
│ │ └ ssd1298.h
│ └ source
│ │ BSP_Config.c
│ │ joystick.c
│ │ key.c
│ │ LCD.c
│ └ led.c
├ CMSIS
│ ├ inc
│ │ │ core_cm3.h
│ │ │ core_cmFunc.h
│ │ │ core_cmInstr.h
│ │ │ LPC17xx.h
│ │ └ system_LPC17xx.h
│ └ src
│ │ core_cm3.c
│ │ startup_LPC17xx.s
│ └ system_LPC17xx.c
├ Drivers
│ ├ include
│ │ │ 24LC02.h
│ │ │ command.h
│ │ │ lpc1768_i2c.h
│ │ │ lpc1768_rtc.h
│ │ │ lpc1768_timer.h
│ │ │ lpc1768_uart.h
│ │ └ monitor.h
│ └ source
│ │ 24LC02.c
│ │ command.c
│ │ lpc1768_i2c.c
│ │ lpc1768_rtc.c
│ │ lpc1768_timer.c
│ │ lpc1768_uart_interrupt.c
│ │ lpc1768_uart_polling.c
│ └ monitor.c
└ Ex10_Final
│ Ex10_Final.uvgui.Administrator
│ Ex10_Final.uvgui.k
│ Ex10_Final.uvgui_Administrator.bak
│ Ex10_Final.uvgui_k.bak
│ Ex10_Final.uvopt
│ Ex10_Final.uvproj
│ Ex10_Final_Target 1.dep
│ Ex10_Final_uvopt.bak
│ Ex10_Final_uvproj.bak
│ JLinkLog.txt
│ JLinkSettings.ini
├ List
│ │ Ex10_Final.map
│ └ startup_LPC17xx.lst
├ Obj
│ │ 24lc02.crf
│ │ 24lc02.d
│ │ 24lc02.o
│ │ always.crf
│ │ always.d
│ │ always.o
│ │ beifen.crf
│ │ beifen.d
│ │ beifen.o
│ │ bsp_config.crf
│ │ bsp_config.d
│ │ bsp_config.o
│ │ command.crf
│ │ command.d
│ │ command.o
│ │ core_cm3.crf
│ │ core_cm3.d
│ │ core_cm3.o
│ │ cursor.crf
│ │ cursor.d
│ │ cursor.o
│ │ date.crf
│ │ date.d
│ │ date.o
│ │ Ex10_Final.axf
│ │ Ex10_Final.htm
│ │ Ex10_Final.lnp
│ │ Ex10_Final.plg
│ │ Ex10_Final.sct
│ │ Ex10_Final.tra
│ │ ExtDll.iex
│ │ home.crf
│ │ home.d
│ │ home.o
│ │ iic.crf
│ │ iic.d
│ │ iic.o
│ │ joystick.crf
│ │ joystick.d
│ │ joystick.o
│ │ key.crf
│ │ key.d
│ │ key.o
│ │ lcd.crf
│ │ lcd.d
│ │ lcd.o
│ │ led.crf
│ │ led.d
│ │ led.o
│ │ lpc1768_i2c.crf
│ │ lpc1768_i2c.d
│ │ lpc1768_i2c.o
│ │ lpc1768_rtc.crf
│ │ lpc1768_rtc.d
│ │ lpc1768_rtc.o
│ │ lpc1768_timer.crf
│ │ lpc1768_timer.d
│ │ lpc1768_timer.o
│ │ lpc1768_uart_polling.crf
│ │ lpc1768_uart_polling.d
│ │ lpc1768_uart_polling.o
│ │ main.crf
│ │ main.d
│ │ main.o
│ │ monitor.crf
│ │ monitor.d
│ │ monitor.o
│ │ more.crf
│ │ more.d
│ │ more.o
│ │ note.crf
│ │ note.d
│ │ note.o
│ │ other.crf
│ │ other.d
│ │ other.o
│ │ repeat.crf
│ │ repeat.d
│ │ repeat.o
│ │ settime.crf
│ │ settime.d
│ │ settime.o
│ │ settime.__i
│ │ startup_LPC17xx.d
│ │ startup_LPC17xx.o
│ │ system_lpc17xx.crf
│ │ system_lpc17xx.d
│ │ system_lpc17xx.o
│ │ time.crf
│ │ time.d
│ │ time.o
│ │ zancun.crf
│ │ zancun.d
│ └ zancun.o
└ Source
│ Always.c
│ Date.c
│ Home.c
│ main.c
│ More.c
│ Other.c
│ Time.c
└ User.h