sdfat library 10 variable in 1ms ?

hi everybody ,

I am trying to identify the model of my quadcopter , I use an sd-card to save the input and the output of

the model , about 10 variable each 2 byte . my loop should not be over 4ms "250hz"

I suppose my programe take 3ms to exctuted and I reserved 1 ms to save data in sc-card ,

is this possible ? using sdfat library ? , if not than what is the solution ?? by the way I am using

STM32c103. thanks

You can time it :wink:

Record the start time ( millis() or micros() )
2)
Write 20 bytes to sd
3)
Flush the data
4)
Record the end time
5)
Subtract and you have the time how long it takes.

Note
I think that flushing 20 bytes or 512 bytes (the buffer size) takes the same time.

Why do you want to read/save the model of the quadcopter that often? I doubt it ever changes (after all, a BMW F650 Funduro will never change to a BMW1200GS) but have no experience with this stuff.

thank you for replying

I wrote this text : "1, 2, 3" in file test.txt it took about 15ms.

I want to read/save the data in order to use them in matlab software

to identifiy the dynamique model of the quadrotor .