⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lab3.c

📁 使用PIC24 16位单片机 读写SD卡 支持FAT32
💻 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 + -