12.07.2015 Views

MPLAB® C18 C 编译器函数库

MPLAB® C18 C 编译器函数库

MPLAB® C18 C 编译器函数库

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

软 件 外 设 函 数 库3.2.2 使 用 示 例#include #include #include #include void DelayFor18TCY( void ){Nop();Nop();Nop();Nop();Nop();Nop();Nop();Nop();Nop();Nop();Nop();Nop();}void DelayPORXLCD( void ){Delay1KTCYx(60); //Delay of 15msreturn;}void DelayXLCD( void ){Delay1KTCYx(20); //Delay of 5msreturn;}void main( void ){char data;// configure external LCDOpenXLCD( EIGHT_BIT & LINES_5X7 );// configure USARTOpenUSART( USART_TX_INT_OFF & USART_RX_INT_OFF &USART_ASYNCH_MODE & USART_EIGHT_BIT &USART_CONT_RX,25);while(1){while(!DataRdyUSART()); //wait for datadata = ReadUSART(); //read dataWriteDataXLCD(data); //write to LCDif(data=='Q')break;}CloseUSART();}© 2004 Microchip Technology Inc. DS51297C_CN 第 71 页

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!