int SD_text()
{
/* func
tion disk_initialize() has been called in f_open */
/* Create new file on the drive 0 */
res = f_open(&fnew, "0:newfile.txt", FA_OPEN_ALWAYS | FA_WRITE );
if ( res == FR_OK )
{
ILI9341_DispString_EN ( 60, 250, "start writing", macBACKGROUND, macRED );
}
f_lseek(&fnew,fnew.fsize);
res = f_write(&fnew, textFileBuffer, sizeof(textFileBuffer)-1, &bw);
f_close(&fnew);
f_mount(0, NULL);
}
int juece()
{
textFileBuffer[0]=Num[0];
textFileBuffer[1]=Num[1];
textFileBuffer[2]=' ';
textFileBuffer[3]=' ';
SD_text();
}
int main ( void )
{
f_mount(0,&fs);
while(1)
{
Fasongjieshou_232();
Fasongjieshou_485();
if(KalmanBegin<20)
{
KalmanBegin++;
}
else juece();
}
}
一周热门 更多>