I'm receiving (rotation times from 4 motors) data from serial port.
I'm using:
fileread = fopen(file_name);
%Convert to float
times = fread(fileread,'float32')
Values are binary and have a format(after reading): Example 1:
times =
11012,4443359375
11012,7773826587
11012,7773488505
11012,7773178500
then I calculate a (motorspeed):
%Solve full rotation speed (Hz)
motorspeed = 1./(2.*times);
and get answer
motorspeed =
45.403
45.413
45.233
45.783
But if I,m using just 1 motor from 4 i get this values: Example 2:
times =
11012,4443359375
6,44429277903543e-39
2,51729256131310e-41
9,80908925027372e-44
and
motorspeed =
45.403
77588032875632144111403251571861040368975872.000
19862609840597303702026941971780138162366447616.000
5097313188235571189218766267134897934598963986432.000
- Why I,m getting receive a values like 6,44429277903543e-39, I,m just sending a zero via serial interface?
Thank you very much!