Helo everybody, i'm trying to convert a simulink model from float to fixed point variables to see if i can improve or not its velocity on arduino. i should decide a suitable data type to run on target for Arduino mega2560. simulink suggestion is: fixdt(Signed, WordLength, FractionLength). however,it's not clear (to me) if that data type becomes an int type on arduino or not and how it is treated in that case.i've tried a trivial model using that data type, it runs on arduino but doesn't seem to improve velocity.. what do you think about it?

the simple model was still in simulink and i did it just to know if arduino can handle fixdt data type. i wouldn't even know how to write that data type on the ide. is there any easier way to represent a fixed point variable?

What you can do, is represent your problem using integers. For example, if your GPS problem originallyuses floating point numbers which represent metres, you can change it to use integers which represent millimetres.

The type needs to be chosen so that the variables can hold the full range of values that they need to hold. So you need to work out what the range of possible values is, and then choose the appropriate integer type to hold those values.

For example if you need to hold a percentage (0 .. 100) to three decimal places then the range of possible values is 0 .. 100000; a long is the most appropriate integer type for that range.

I only provide help via the forum - please do not contact me for private consultancy.

clear. when i choose to my question is just if you know something about how this fixdt data type works on arduino (in the signal notation of simulink, an example of this variable is called sfix16_en5 - 16 is the word lenght, 5 the fraction lenght - and it's a fixed point data type which uses int16 as "container") thank you