📄 lab3.c
字号:
// Lab3.c
#include "fileio.h"
#include "lcd.h"
#define linelength 16
void LCDwait (void);
int main (void)
{
FILE * myFile;
size_t lengthOfString;
char length = 0;
char buffer[50];
char * pBuffer = (char *)&buffer;
/*********************************************************************************/
/* Your code goes here */
/* Hints: */
/* - The file you are reading is called data.txt */
/* - The test you are reading is smaller than the size of the buffer */
/* - The number of bytes that should be put on the LCD should be stored in the */
/* variable lengthOfString */
/*********************************************************************************/
/**********************************************************************************/
// Setup the LCD
mLCDInit();
LCDProcessEvents();
LCDwait();
mLCDHome();
LCDProcessEvents();
LCDwait();
while (lengthOfString)
{
if (!mLCDIsBusy() )
{
if (length == linelength)
{
mLCDPutCmd(0xC0);
length = 0;
LCDProcessEvents();
LCDwait();
}
else
{
mLCDPutChar(*pBuffer);
pBuffer++;
length++;
lengthOfString--;
}
}
LCDProcessEvents();
}
LCDwait();
while(1);
}
void LCDwait (void)
{
while (mLCDIsBusy())
LCDProcessEvents();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -