dsfa

Dependencies:   dsf SDFileSystem TextLCD mbed stepper_moter

Fork of my_example_Nucleo_Ex05_SD_zhangyuxiang2 by liang brain

main.cpp

Committer:
brainliang
Date:
2018-05-08
Revision:
4:c88bf297ee75
Parent:
3:1e51c10aa4f2

File content as of revision 4:c88bf297ee75:

#include "mbed.h"
#include "SDRead.h"
#include "LCDShow.h"

QEI Choose(PB_5,PB_8, NC, 11, QEI::X2_ENCODING);
InterruptIn btn3(PA_5);

//LCD显示屏  rs,     e,    d4-d7,                    model
LCDShow lcd(PC_13, PC_14, PC_15, PA_0, PA_1, PA_4, TextLCD::LCD20x4); // rs, e, d4-d7, model  V4版本  屏幕为4行,每行20字符(列)
SDRead sd(PB_15, PB_14, PB_13, PB_12, "sd");

int main()
{
    sd.mount();             //加注释!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    while(1)
    {
        if(sd.Get_FileDir())        //加注释!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        {
            lcd.getDir(sd.File_dir);    //加注释!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            lcd.showdir();//LCD显示文件目录
        }
        if(lcd.Read_file)       //加注释!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        {
            if(sd.Read_File(lcd.file_name.data()))
            {
                for(int i = 0; i < sd.Info.size(); i++)//sd.Info 就是读取到的文件信息向量
                {
                    printf("%s\n",sd.Info[i]);
                }
            }
        }
    }
}