换行怎么输入?
mCmdParam.ByteWrite.mByteBuffer[0] = '/';
mCmdParam.ByteWrite.mByteBuffer[1] = 'n';
mCmdParam.ByteWrite.mByteCount = 2; /* 指定本次写入的字节数,单次读写的长度不能超过MAX_BYTE_IO */
还是怎么写?,上边那个不行我试过了写mCmdParam.ByteWrite.mByteBuffer[1] =0x0d;也不行
mCmdParam.Locate.mSectorOffset= 0xffffffff;//移动到文件尾
CH375ByteLocate();
移动后数据写不进去了,求解
mCmdParam.Open.mPathName[0] = '/'; mCmdParam.Open.mPathName[1] = dataa[0]; mCmdParam.Open.mPathName[2] = dataa[2]; mCmdParam.Open.mPathName[3] = '.'; mCmdParam.Open.mPathName[4] = 'P'; mCmdParam.Open.mPathName[5] = 0; i =CH375FileOpen(); //打开文件 // i = CH375FileCreate( ); /* 新建文件并打开,如果文件已经存在则先删除后再新建 */ mStopIfError( i ); mCmdParam.Locate.mSectorOffset= 0xffffffff;//移动到文件尾 CH375ByteLocate(); //加上就写不进去了 OLED_Showhex(0,0,mCmdParam.Locate.mSectorOffset,8);//显示返回值为0011EF18 data_Write ('W',48612,46532); data_Write ('U',48612,46532);//实验用数据不用在意
void data_Write (unsigned char bit,unsigned int volt,unsigned int curr)// { unsigned char i; mCmdParam.ByteWrite.mByteBuffer[0] = bit; mCmdParam.ByteWrite.mByteBuffer[1] = dataa[volt/10000%10];//65535 mCmdParam.ByteWrite.mByteBuffer[2] = dataa[volt/1000%10]; mCmdParam.ByteWrite.mByteBuffer[3] = dataa[volt/100%10]; mCmdParam.ByteWrite.mByteBuffer[4] = dataa[volt/10%10]; mCmdParam.ByteWrite.mByteBuffer[5] = dataa[volt%10]; mCmdParam.ByteWrite.mByteBuffer[6] = '-'; mCmdParam.ByteWrite.mByteBuffer[7] = dataa[curr/10000%10];//65535 mCmdParam.ByteWrite.mByteBuffer[8] = dataa[curr/1000%10]; mCmdParam.ByteWrite.mByteBuffer[9] = dataa[curr/100%10]; mCmdParam.ByteWrite.mByteBuffer[10] = dataa[curr/10%10]; mCmdParam.ByteWrite.mByteBuffer[11] = dataa[curr%10]; mCmdParam.ByteWrite.mByteBuffer[12] = '/'; mCmdParam.ByteWrite.mByteCount = 13; /* 指定本次写入的字节数,单次读写的长度不能超过MAX_BYTE_IO */ i = CH375ByteWrite( ); /* 以字节为单位向文件写入数据,单次读写的长度不能超过MAX_BYTE_IO */ mStopIfError( i ); //CH375FileClose( );//关闭当前文件 //delay_ms(100); }
热门产品 :
CH32X035: 32位USB+USB PD单片机