【正文】
} * 名稱 : write_byte() * 功能 : 向 DS18B20 寫一個字節(jié) * 輸入 : val(要對 DS18B20 寫入的命令值) * 輸出 : 無 void write_byte(uchar val) { uchar i,temp。 for(i=0。 i8。 i++) { temp = val i。 temp = temp amp。 0x01。 write_bit(temp)。 delay(5)。 } } /* 定時中斷 */ 27 void tim(void) interrupt 3 using 1 { static unsigned char count。 // TH0=(655361000)/256。 TL0=(655361000)%256。//定時 1mS if (count==PWM_ON) { PWM = 1。 //燈滅 } count++。 if(count == CYCLE) { count=0。 if(PWM_ON!=0) //如果左右時間是 0 保持原來狀態(tài) PWM = 0。//燈亮 } } //這三個引腳參考資料 sbit E=P2^7。 //1602 使能引腳 sbit RW=P2^6。 //1602 讀寫引腳 sbit RS=P2^5。 //1602 數(shù)據(jù) /命令選擇引腳 void delay_3() { int i,j。 for(i=0。 i100。 i++) for(j=0。 j20。 j++) 。 } * 名稱 : enable(uchar del) 28 * 功能 : 1602 命令函數(shù) * 輸入 : 輸入的命令值 * 輸出 : 無 void enable(uchar del) { P0 = del。 RS = 0。 RW = 0。 E = 0。 delay_3()。 E = 1。 delay_3()。 } * 名稱 : write(uchar del) * 功能 : 1602 寫數(shù)據(jù)函數(shù) * 輸入 : 需要寫入 1602 的數(shù)據(jù) * 輸出 : 無 void write(uchar del) { P0 = del。 RS = 1。 RW = 0。 E = 0。 delay_3()。 E = 1。//高脈沖 delay_3()。 } * 名稱 : L1602_init() * 輸入 : 無 29 * 輸出 : 無 void L1602_init(void) { enable(0x01)。//0000 0001 顯示清屏 enable(0x38)。//0010 0110 顯示模式設置 enable(0x0c)。//0000 1101 顯示開及光標設置 enable(0x06)。//0000 0110 顯示光 標移動設置 enable(0xd0)。// 顯示關閉 } * 名稱 : L1602_char(uchar hang,uchar lie,char sign) * 功能 : 改變液晶中某位的值,如果要讓第一行,第五個字符顯示 b ,調用該函數(shù)如下 L1602_char(1,5,39。b39。) * 輸入 : 行,列,需要輸入 1602 的數(shù)據(jù) * 輸出 : 無 void L1602_char(uchar hang,uchar lie,char sign) { uchar a。 if(hang == 1) a = 0x80。 if(hang == 2) a = 0xc0。 a = a + lie 1。 enable(a)。 write(sign)。 } * 名稱 : L1602_string(uchar hang,uchar lie,uchar *p) * 功能 : 改變液晶中某位的值,如果要讓第一行,第五個字符開始顯示 ab cd ef ,調用該函數(shù)如下 L1602_string(1,5,ab cd ef。) 30 * 輸入 : 行,列,需要輸入 1602 的數(shù)據(jù) * 輸出 : 無 void L1602_string(uchar hang,uchar lie,uchar *p) { uchar a。 if(hang == 1) a = 0x80。 if(hang == 2) a = 0xc0。 a = a + lie 1。 enable(a)。 while(1) { if(*p == 39。\039。) break。 write(*p)。 p++。 } } * 名稱 : Main() * 輸入 : 無 * 輸出 : 無 void main() { uint temp0=0。 uchar lvbo。 //uchar PWM_Num。//定義檔位 TMOD |=0x01。//定時器設置 1ms in 12M crystal TH0=(655361000)/256。 TL0=(655361000)%256。//定時 1mS IE= 0x82。 //打開中斷 CYCLE = 10。// 時間可以調整 這個是 10 步調整 周期 10ms 8 位 PWM 就 31 是 256 步 L1602_init()。 //L1602_char(1,5,39。b39。)。 L1602_string(1,2, wendu )。 L1602_string(2,1, dangwei )。 while(1) { TR0=0。 Reset()。 write_byte(jump_ROM)。 write_byte(start)。 Reset()。 write_byte(jump_ROM)。 write_byte(read_EEROM)。 TMPL = read_byte()。 TMPH = read_byte()。 temp = TMPL / 16 + TMPH * 16。 TR0=1。 delay(50000)。 delay(50000)。 L1602_char(1, 10, temp/10%10 + 48)。 L1602_char(1, 11, temp%10 + 48)。 if(temp25amp。amp。temp=32) { PWM_ON=4。 } if(temp=33) { PWM_ON=0。 } 32 L1602_char(2, 10, PWM_ON+ 48)。 } } 您好,為你提供優(yōu)秀的畢業(yè)論文參考資料,請您刪除以下內容, O(∩_∩)O謝謝?。?!A national survey was recently launched to evaluate the eye health of Chinese children andteen June 6, China39。s annual National Day for Eye Care, the China Youth Development ServiceCenter and Zhejiang Medicine, a leading listed Chinese pharmaceutical pany, jointlyannounced the kickoff of the about one month, a questionnaire piled by top eye care medical experts in China willbe distributed through multiple online partners, including Health., as well asthrough offline survey events held in universities, middle schools and primary schools acrossthe report will be released based on the survey statistics and analysis, and most importantly,guidelines for parents and youth on how to care for the eyes and prevent myopia — agrowing problem in China39。s digitized society, will also be attached on the report.Myopia is not only a disease that makes people see things blurrily, but also leads to severeplications, such as glaua (increased pressure within the eyeball), and can causeblindness, said Zhou Yuehua, an established eye care specialist with Beijing TongrenHospital.It is very important for parents and children to know about the risk and care for their eyes.There are about 450 million myopia patients in China. Among Chinese myopia patients,30million are severe patients, according to ZhouThe prevalence of myopia among high school and college students is more than 70 percent,and the situation is continuously worsening, he Zhu, director with the China Youth Development Service Center, said long hours ofstudy, lack of exercise, especially outdoor activities, and attachment to electronic screen aresome of the top reasons behind the widespread myopia problems, and the increase ofyounger patients, although China has made great progress in improving the hardwarefacilities and lighting conditions in said he hopes the survey will alert people on the threatening situation, and also helpmedical experts to better guideline parents and children39。s behaviors to care for eyes, basedon the timely and factual statistics the survey series of followup events will also be held in six cities, including Jinan in Shandongprovince, and Changsha in Hunan province, to educate people on how to care for eyes afterthe survey started. More and more Chinese are jogging to get and stay fit. Most joggers will run alone, but some will jog with friends or even coaches. The Beijing Olympic Forest Park is one of the most popular spots. It is packed with runners in the afternoon, usually after work, and at weekends. Jogging after a whole day39。s work can be a way to unwind. It is true for He Wenjun, whose workplace is