電子工程訓(xùn)練課程實(shí)驗(yàn)報(bào)告無(wú)線藍(lán)牙小車(共23頁(yè))_第1頁(yè)
電子工程訓(xùn)練課程實(shí)驗(yàn)報(bào)告無(wú)線藍(lán)牙小車(共23頁(yè))_第2頁(yè)
電子工程訓(xùn)練課程實(shí)驗(yàn)報(bào)告無(wú)線藍(lán)牙小車(共23頁(yè))_第3頁(yè)
電子工程訓(xùn)練課程實(shí)驗(yàn)報(bào)告無(wú)線藍(lán)牙小車(共23頁(yè))_第4頁(yè)
電子工程訓(xùn)練課程實(shí)驗(yàn)報(bào)告無(wú)線藍(lán)牙小車(共23頁(yè))_第5頁(yè)
已閱讀5頁(yè),還剩19頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上題目:基于STC15W4K32S4的藍(lán)牙智能小車課程名稱: 學(xué)院(系): 專 業(yè): 班 級(jí): 學(xué) 號(hào): 實(shí)驗(yàn)序號(hào): 學(xué)生姓名: 成 績(jī): 2016 年 11月 4日成績(jī)?cè)u(píng)定項(xiàng)目各項(xiàng)總分得分焊接30最小系統(tǒng)與電源10功能實(shí)現(xiàn)45實(shí)驗(yàn)報(bào)告10出勤5總分電子安裝實(shí)驗(yàn)室安全守則(請(qǐng)?jiān)谙乱豁?yè)手抄一份安全守則)1、 每次實(shí)驗(yàn)前,認(rèn)真預(yù)習(xí)準(zhǔn)備,仔細(xì)閱讀實(shí)驗(yàn)安全守則,嚴(yán)格按照安全規(guī)范進(jìn)行實(shí)驗(yàn),確保實(shí)驗(yàn)安全;2、 桌面要保持整潔,不允許有雜物,禁止將水杯、瓶裝水放在桌面;3、 電烙鐵在使用前,必須檢查電源線有無(wú)燙損漏線情況,一經(jīng)發(fā)現(xiàn),立即找老師進(jìn)行安全處理;4、 電烙鐵長(zhǎng)時(shí)間不使用,應(yīng)

2、將電源線拔掉;電烙鐵使用后,應(yīng)放回烙鐵架中,以免燙傷物品;5、 實(shí)驗(yàn)結(jié)束后,必須拔掉電烙鐵的電源線;已經(jīng)加熱的電烙鐵,必須冷卻后再放入抽屜中;6、 焊錫中含鉛,不要含在口中,實(shí)驗(yàn)結(jié)束后要洗手;7、 穩(wěn)壓電源在使用前,應(yīng)先調(diào)好要使用的電壓,再進(jìn)行線路連接,并確保連接的極性正確;8、 搶救觸電人員時(shí),應(yīng)首先切斷電源或用絕緣物體挑開(kāi)電源線,使觸電者脫離電源,千萬(wàn)不要用手拖拉觸電人員,以免連環(huán)觸電;9、 實(shí)驗(yàn)結(jié)束后,必須關(guān)閉桌面電源開(kāi)關(guān),將桌面收拾干凈,工具物品整理好。題目:1 設(shè)計(jì)要求以STC15W4K32S4單片機(jī)為核心,設(shè)計(jì)焊接并且調(diào)試一個(gè)實(shí)際的單片機(jī)控制系統(tǒng),通過(guò)藍(lán)牙實(shí)現(xiàn)用手機(jī)控制小車的動(dòng)作狀

3、態(tài)。(1) 焊接:在實(shí)現(xiàn)基本功能的前提下焊接好設(shè)計(jì)的系統(tǒng),盡量使其穩(wěn)定焊點(diǎn)穩(wěn)定,焊接美觀。(2) 最小系統(tǒng)與電源:利用7505穩(wěn)壓芯片實(shí)現(xiàn)輸入電壓轉(zhuǎn)為五伏穩(wěn)壓電源輸出。(3) 功能實(shí)現(xiàn):實(shí)現(xiàn)用手機(jī)自制app或者藍(lán)牙串口助手控制小車前進(jìn)方向以及行駛速度。2 設(shè)計(jì)分析及系統(tǒng)方案設(shè)計(jì)圍繞STC15W4K32S4單片機(jī),把系統(tǒng)的設(shè)計(jì)規(guī)劃分為兩部分硬件部分:(1) 設(shè)計(jì)并且繪制原理圖(2) 按照原理圖焊接電路板軟件部分:(1) 編寫實(shí)驗(yàn)程序(2) 系統(tǒng)調(diào)試將單片機(jī)的p0口用于驅(qū)動(dòng)lcd1602,p4.5,p2.7,p2.3,p2.2用于輸出pwm控制電機(jī)。P3.0與p3.1用于與主機(jī)通信并且用于藍(lán)牙串口

4、通信。3 各功能模塊硬件電路設(shè)計(jì)(1) 最小系統(tǒng)由于STC15W4K32S4的性能已經(jīng)進(jìn)行了優(yōu)化,所以不同于以往所接觸的單片機(jī),它的晶振已經(jīng)集成化,不用再搭建最小系統(tǒng)電路。(2) 電源電路將輸入電壓轉(zhuǎn)為5v穩(wěn)壓電源輸出(3) LCD液晶屏電路使用P1.0P1.7與D0D7相接,EN,RW,RS分別與P0.7,P0.6,P0.5相接(4) 藍(lán)牙與單片機(jī)連接這里直接用P3.0,P3.1與主機(jī)的串口通信和與藍(lán)牙共用串口。(5) LN298模塊4 系統(tǒng)軟件設(shè)計(jì)#include reg51.h#include intrins.h#include stdio.h#include stdlib.h#defi

5、ne MAIN_Fosc L /定義主時(shí)鐘/* 變量聲明 */ typedef unsigned char u8;typedef unsigned int u16;typedef unsigned long u32;typedef unsigned char BYTE;typedef unsigned int WORD;#define uchar unsigned char#define uint unsigned int#define elif else if#define PWMC (*(unsigned int volatile xdata *)0xfff0)#define PWMCH

6、(*(unsigned char volatile xdata *)0xfff0)#define PWMCL (*(unsigned char volatile xdata *)0xfff1)#define PWMCKS (*(unsigned char volatile xdata *)0xfff2)#define PWM2T1 (*(unsigned int volatile xdata *)0xff00)#define PWM2T1H (*(unsigned char volatile xdata *)0xff00)#define PWM2T1L (*(unsigned char vol

7、atile xdata *)0xff01)#define PWM2T2 (*(unsigned int volatile xdata *)0xff02)#define PWM2T2H (*(unsigned char volatile xdata *)0xff02)#define PWM2T2L (*(unsigned char volatile xdata *)0xff03)#define PWM2CR (*(unsigned char volatile xdata *)0xff04)#define PWM3T1 (*(unsigned int volatile xdata *)0xff10

8、)#define PWM3T1H (*(unsigned char volatile xdata *)0xff10)#define PWM3T1L (*(unsigned char volatile xdata *)0xff11)#define PWM3T2 (*(unsigned int volatile xdata *)0xff12)#define PWM3T2H (*(unsigned char volatile xdata *)0xff12)#define PWM3T2L (*(unsigned char volatile xdata *)0xff13)#define PWM3CR (

9、*(unsigned char volatile xdata *)0xff14)#define PWM4T1 (*(unsigned int volatile xdata *)0xff20)#define PWM4T1H (*(unsigned char volatile xdata *)0xff20)#define PWM4T1L (*(unsigned char volatile xdata *)0xff21)#define PWM4T2 (*(unsigned int volatile xdata *)0xff22)#define PWM4T2H (*(unsigned char vol

10、atile xdata *)0xff22)#define PWM4T2L (*(unsigned char volatile xdata *)0xff23)#define PWM4CR (*(unsigned char volatile xdata *)0xff24)#define PWM5T1 (*(unsigned int volatile xdata *)0xff30)#define PWM5T1H (*(unsigned char volatile xdata *)0xff30)#define PWM5T1L (*(unsigned char volatile xdata *)0xff

11、31)#define PWM5T2 (*(unsigned int volatile xdata *)0xff32)#define PWM5T2H (*(unsigned char volatile xdata *)0xff32)#define PWM5T2L (*(unsigned char volatile xdata *)0xff33)#define PWM5CR (*(unsigned char volatile xdata *)0xff34)#define PWM6T1 (*(unsigned int volatile xdata *)0xff40)#define PWM6T1H (

12、*(unsigned char volatile xdata *)0xff40)#define PWM6T1L (*(unsigned char volatile xdata *)0xff41)#define PWM6T2 (*(unsigned int volatile xdata *)0xff42)#define PWM6T2H (*(unsigned char volatile xdata *)0xff42)#define PWM6T2L (*(unsigned char volatile xdata *)0xff43)#define PWM6CR (*(unsigned char vo

13、latile xdata *)0xff44)#define PWM7T1 (*(unsigned int volatile xdata *)0xff50)#define PWM7T1H (*(unsigned char volatile xdata *)0xff50)#define PWM7T1L (*(unsigned char volatile xdata *)0xff51)#define PWM7T2 (*(unsigned int volatile xdata *)0xff52)#define PWM7T2H (*(unsigned char volatile xdata *)0xff

14、52)#define PWM7T2L (*(unsigned char volatile xdata *)0xff53)#define PWM7CR (*(unsigned char volatile xdata *)0xff54)sfr PWMCFG = 0xf1;sfr PWMCR = 0xf5;sfr PWMIF = 0xf6;sfr PWMFDCR = 0xf7;sfr TH2 = 0xD6;sfr TL2 = 0xD7;sfr IE2 = 0xAF;sfr INT_CLKO = 0x8F;sfr AUXR = 0x8E;sfr AUXR1 = 0xA2;sfr P_SW1 = 0xA

15、2;sfr P_SW2 = 0xBA;sfr PIN_SW2 =0xBA;sfr S2CON = 0x9A;sfr S2BUF = 0x9B;sfr P4 = 0xC0;sfr P5 = 0xC8;sfr P6 = 0xE8;sfr P7 = 0xF8;sfr P1M1 = 0x91; /PxM1.n,PxM0.n =00-Standard, 01-push-pullsfr P1M0 = 0x92; / =10-pure input, 11-open drainsfr P0M1 = 0x93;sfr P0M0 = 0x94;sfr P2M1 = 0x95;sfr P2M0 = 0x96;sfr

16、 P3M1 = 0xB1;sfr P3M0 = 0xB2;sfr P4M1 = 0xB3;sfr P4M0 = 0xB4;sfr P5M1 = 0xC9;sfr P5M0 = 0xCA;sfr P6M1 = 0xCB;sfr P6M0 = 0xCC;sfr P7M1 = 0xE1;sfr P7M0 = 0xE2;sbit P00 = P00;sbit P01 = P01;sbit P02 = P02;sbit P03 = P03;sbit P04 = P04;sbit P05 = P05;sbit P06 = P06;sbit P07 = P07;sbit P10 = P10;sbit P11

17、 = P11;sbit P12 = P12;sbit P13 = P13;sbit P14 = P14;sbit P15 = P15;sbit P16 = P16;sbit P17 = P17;sbit P20 = P20;sbit P21 = P21;sbit P22 = P22;sbit P23 = P23;sbit P24 = P24;sbit P25 = P25;sbit P26 = P26;sbit P27 = P27;sbit P30 = P30;sbit P31 = P31;sbit P32 = P32;sbit P33 = P33;sbit P34 = P34;sbit P35

18、 = P35;sbit P36 = P36;sbit P37 = P37;sbit P40 = P40;sbit P41 = P41;sbit P42 = P42;sbit P43 = P43;sbit P44 = P44;sbit P45 = P45;sbit P46 = P46;sbit P47 = P47;sbit P50 = P50;sbit P51 = P51;sbit P52 = P52;sbit P53 = P53;sbit P54 = P54;sbit P55 = P55;sbit P56 = P56;sbit P57 = P57;/* 收發(fā)定義 */#define Baudr

19、ate1 9600L/波特率#define UART1_BUF_LENGTH 32u8 TX1_Cnt; /發(fā)送計(jì)數(shù)u8 RX1_Cnt; /接收計(jì)數(shù)bit B_TX1_Busy; /發(fā)送忙標(biāo)志void UART1_config(u8 brt); / 選擇波特率, 2: 使用Timer2做波特率, 其它值: 使用Timer1做波特率.void PrintString1(u8 *puts);u8 idata RX1_BufferUART1_BUF_LENGTH; /接收緩沖/* IO口定義 */sbit P_HC595_SER = P40; /pin 14 SER data inputsbit

20、P_HC595_RCLK = P54; /pin 12 RCLk store (latch) clocksbit P_HC595_SRCLK = P43; /pin 11 SRCLK Shift data clock/* 本地變量聲明 */void delay_ms(u8 ms);void DisableHC595(void);void Initialize_LCD(void);void Write_AC(u8 hang,u8 lie);void Write_DIS_Data(u8 DIS_Data);void ClearLine(u8 row);u8 BIN_ASCII(u8 tmp);vo

21、id PutString(u8 row, u8 column, u8 *puts);void WriteChar(u8 row, u8 column, u8 dat);/* 變量聲明 */#define CYCLE 0x1000L /定義PWM周期(最大值為32767)u8 DirLeft15=Dir Left;u8 DirRight15=Dir Right;u8 DirUp15=Dir Up;u8 DirDown15=Dir Down;u8 HSpeed15=Speed Normal;u8 NSpeed15=Speed Hight;int flag = 0;sbit Pdir1 =P21;s

22、bit Pdir2 =P22;sbit Pfir1 =P23;sbit Pfir2 =P27;void IoInit(void);void SendMegBack(void);void ENpwm(WORD DUTY1,WORD DUTY2,WORD outch,WORD outen);void closepwm();WORD Speed1=75L;WORD Speed2=80L;WORD Fspeed1=75l;WORD Fspeed2=80L;bit Dir=0;/=void main(void)IoInit(); /初始化端口 Initialize_LCD();/初始化端口lcdUART

23、1_config(1); / 選擇波特率, 2: 使用Timer2做波特率, 其它值: 使用Timer1做波特率. EA = 1; /允許總中斷 while(1) flag=SBUF;SendMegBack();switch(flag)case 0: ClearLine(1); PutString(1,0,DirLeft); Fspeed1=Speed1;Fspeed2=18*Speed2/32; break;case 1: ClearLine(1); PutString(1,0,DirRight); Fspeed1=19*Speed1/32;Fspeed2=Speed2; break;cas

24、e 2: ClearLine(1); PutString(1,0,DirUp); Fspeed1=Speed1;Fspeed2=Speed2; Dir=0; break;case 3: ClearLine(1); PutString(1,0,DirDown); Fspeed1=Speed1;Fspeed2=Speed2; Dir=1; break;case 4: ClearLine(0); PutString(0,0,NSpeed); Speed1=95L;Speed2=100L; Fspeed1=Speed1;Fspeed2=Speed2; break;case 5: ClearLine(0

25、); PutString(0,0,HSpeed); Speed1=75L;Speed2=80L; Fspeed1=Speed1;Fspeed2=Speed2; break;case 6: ClearLine(0); PutString(0,0,NSpeed); Speed1=Speed1-2l;Speed2=Speed2-2l; Fspeed1=Speed1;Fspeed2=Speed2; break;case 7: ClearLine(0); PutString(0,0,NSpeed); Speed1=Speed1+2l;Speed2=Speed2+2l; Fspeed1=Speed1;Fs

26、peed2=Speed2; break;default: ClearLine(0); PutString(0,0,HSpeed); Speed1=75L;Speed2=80L; Fspeed1=Speed1;Fspeed2=Speed2; break;if(Dir=0)ENpwm(Fspeed1,Fspeed2,0x00,0x0a);Pdir2=0;Pfir2=0;elseENpwm(Fspeed1,Fspeed2,0x00,0x05);Pdir1=0;Pfir1=0;delay_ms(20); /*/void IoInit(void)P0M1 = 0; P0M0 = 0; /設(shè)置為準(zhǔn)雙向口

27、P1M1 = 0; P1M0 = 0; /設(shè)置為準(zhǔn)雙向口 P2M1 = 0; P2M0 = 0; /設(shè)置為準(zhǔn)雙向口 P3M1 = 0; P3M0 = 0; /設(shè)置為準(zhǔn)雙向口 P4M1 = 0; P4M0 = 0; /設(shè)置為準(zhǔn)雙向口 P5M1 = 0; P5M0 = 0; /設(shè)置為準(zhǔn)雙向口 P6M1 = 0; P6M0 = 0; /設(shè)置為準(zhǔn)雙向口 P7M1 = 0; P7M0 = 0; /設(shè)置為準(zhǔn)雙向口void SendMegBack(void)if(TX1_Cnt != RX1_Cnt) & (!B_TX1_Busy) /收到數(shù)據(jù), 發(fā)送空閑SBUF = RX1_BufferTX1_Cnt;

28、/把收到的數(shù)據(jù)遠(yuǎn)樣返回 B_TX1_Busy = 1; if(+TX1_Cnt = UART1_BUF_LENGTH) TX1_Cnt = 0;void ENpwm(WORD DUTY1,WORD DUTY2,WORD outch,WORD outen)PIN_SW2 |= 0x80; /使能訪問(wèn)XSFRPWMCFG = 0x00; /配置PWM的輸出初始電平為低電平PWMCKS = 0x00; /選擇PWM的時(shí)鐘為Fosc/(0+1)PWMC = CYCLE; /設(shè)置PWM周期PWM3T1 = CYCLE * DUTY1/ 100; /設(shè)置PWM2第1次反轉(zhuǎn)的PWM計(jì)數(shù)PWM4T1 = CY

29、CLE * DUTY1/ 100; /設(shè)置PWM2第2次反轉(zhuǎn)的PWM計(jì)數(shù)PWM5T1 = CYCLE * DUTY2 / 100; /設(shè)置PWM3第1次反轉(zhuǎn)的PWM計(jì)數(shù)PWM2T2 =CYCLE * DUTY1/ 100 ; /設(shè)置PWM3第2次反轉(zhuǎn)的PWM計(jì)數(shù)PWM2CR = 0x08; /選擇PWM2輸出引腳,不使能PWM2中斷PWM3CR = 0x00; PWM4CR = 0x00; PWM5CR = 0x00; PWMCR = outen; /使能PWM信號(hào)輸出PWMCR |= 0x80; /使能PWM模塊PIN_SW2 &= 0x80;/占空比為(PWM2T2-PWM2T1)/PWM

30、Cvoid closepwm()PIN_SW2 |= 0x80; /使能訪問(wèn)XSFRPWMCR = 0x00; /使能PWM信號(hào)輸出PWMCR |= 0x80; /使能PWM模塊PIN_SW2 &= 0x80;Pfir1=0;Pfir2=0;Pdir1=0;Pdir2=0;void delay_ms(u8 ms) unsigned int i; do i = MAIN_Fosc / 13000; while(-i) ; /14T per loop while(-ms);void DisableHC595(void) u8 i; P_HC595_SER = 1; for(i=0; i20; i+

31、) P_HC595_SRCLK = 1; P_HC595_SRCLK = 0; P_HC595_RCLK = 1; P_HC595_RCLK = 0; /鎖存輸出數(shù)據(jù) P_HC595_RCLK = 1; P_HC595_RCLK = 0; /鎖存輸出數(shù)據(jù)/ 函數(shù): void RTC(void)/ 描述: RTC演示函數(shù)/ 參數(shù): none./ 返回: none./ 版本: VER1.0/ 日期: 2013-4-1/ 備注: /=/* LCD1602相關(guān)程序 */8位數(shù)據(jù)訪問(wèn)方式 LCD1602 標(biāo)準(zhǔn)程序 梁工編寫 2014-2-21#define LineLength 16 /16x2/* P

32、in define */sfr LCD_BUS = 0x90; /P0-0x80, P1-0x90, P2-0xA0, P3-0xB0sbit LCD_B7 = LCD_BUS7; /D7 - Pin 14 LED- - Pin 16 sbit LCD_B6 = LCD_BUS6; /D6 - Pin 13 LED+ - Pin 15sbit LCD_B5 = LCD_BUS5; /D5 - Pin 12 Vo - Pin 3sbit LCD_B4 = LCD_BUS4; /D4 - Pin 11 VDD - Pin 2sbit LCD_B3 = LCD_BUS3; /D3 - Pin 10

33、VSS - Pin 1sbit LCD_B2 = LCD_BUS2; /D2 - Pin 9sbit LCD_B1 = LCD_BUS1; /D1 - Pin 8sbit LCD_B0 = LCD_BUS0; /D0 - Pin 7sbit LCD_ENA = P07; /Pin 6sbit LCD_RW = P06; /Pin 5 /LCD_RS R/W DB7-DB0 FOUNCTIONsbit LCD_RS = P05; /Pin 4 / 0 0 INPUT write the command to LCD model / 0 1 OUTPUT read BF and AC pointe

34、r from LCD model / 1 0 INPUT write the data to LCD model / 1 1 OUTPUT read the data from LCD model/*total 2 lines, 16x2= 32first line address: 015second line address: 6479*/#define C_CLEAR 0x01 /clear LCD#define C_HOME 0x02 /cursor go home#define C_CUR_L 0x04 /cursor shift left after input#define C_

35、RIGHT 0x05 /picture shift right after input#define C_CUR_R 0x06 /cursor shift right after input#define C_LEFT 0x07 /picture shift left after input#define C_OFF 0x08 /turn off LCD#define C_ON 0x0C /turn on LCD#define C_FLASH 0x0D /turn on LCD, flash #define C_CURSOR 0x0E /turn on LCD and cursor#defin

36、e C_FLASH_ALL 0x0F /turn on LCD and cursor, flash#define C_CURSOR_LEFT 0x10 /single cursor shift left#define C_CURSOR_RIGHT 0x10 /single cursor shift right#define C_PICTURE_LEFT 0x10 /single picture shift left#define C_PICTURE_RIGHT 0x10 /single picture shift right#define C_BIT8 0x30 /set the data i

37、s 8 bits#define C_BIT4 0x20 /set the data is 4 bits#define C_L1DOT7 0x30 /8 bits,one line 5*7 dots#define C_L1DOT10 0x34 /8 bits,one line 5*10 dots#define C_L2DOT7 0x38 /8 bits,tow lines 5*7 dots#define C_4bitL2DOT7 0x28 /4 bits,tow lines 5*7 dots#define C_CGADDRESS0 0x40 /CGRAM address0 (addr=40H+x

38、)#define C_DDADDRESS0 0x80 /DDRAM address0 (addr=80H+x)#define LCD_DelayNop() _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();#define LCD_BusData(dat) LCD_BUS = dat/=void CheckBusy(void) u16 i; for(i=0; i5000; i+)

39、if(!LCD_B7) break; /check the LCD busy or not. With time out/ while(LCD_B7); /check the LCD busy or not. Without time outvoid IniSendCMD(u8 cmd) LCD_RW = 0; LCD_BusData(cmd); LCD_DelayNop(); LCD_ENA = 1; LCD_DelayNop(); LCD_ENA = 0; LCD_BusData(0xff);void Write_CMD(u8 cmd) LCD_RS = 0; LCD_RW = 1; LC

40、D_BusData(0xff); LCD_DelayNop(); LCD_ENA = 1; CheckBusy(); /check the LCD busy or not. LCD_ENA = 0; LCD_RW = 0; LCD_BusData(cmd); LCD_DelayNop(); LCD_ENA = 1; LCD_DelayNop(); LCD_ENA = 0; LCD_BusData(0xff);void Write_DIS_Data(u8 dat) LCD_RS = 0; LCD_RW = 1; LCD_BusData(0xff); LCD_DelayNop(); LCD_ENA

41、 = 1; CheckBusy(); /check the LCD busy or not. LCD_ENA = 0; LCD_RW = 0; LCD_RS = 1; LCD_BusData(dat); LCD_DelayNop(); LCD_ENA = 1; LCD_DelayNop(); LCD_ENA = 0; LCD_BusData(0xff);void Initialize_LCD(void) LCD_ENA = 0; LCD_RS = 0; LCD_RW = 0; delay_ms(100); IniSendCMD(C_BIT8); /set the data is 8 bits

42、delay_ms(10); Write_CMD(C_L2DOT7); /tow lines 5*7 dots delay_ms(6); Write_CMD(C_CLEAR); /clear LCD RAM Write_CMD(C_CUR_R); /Curror Shift Right Write_CMD(C_ON); /turn on LCDvoid ClearLine(u8 row) u8 i; Write_CMD(row & 1) 6) | 0x80); for(i=0; iLineLength; i+) Write_DIS_Data( );void WriteChar(u8 row, u

43、8 column, u8 dat) Write_CMD(row & 1) 6) + column) | 0x80); Write_DIS_Data(dat);void PutString(u8 row, u8 column, u8 *puts) Write_CMD(row & 1) = LineLength) break; /* LCD20 Module END */* 串口部分*/=/ 函數(shù): void PrintString1(u8 *puts)/ 描述: 串口1發(fā)送字符串函數(shù)。/ 參數(shù): puts: 字符串指針./ 返回: none./ 版本: VER1.0/ 日期: 2014-11-28/

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論