智能车制作

标题: 串口助手是不是不能显示浮点型数据 [打印本页]

作者: 沉默遇上寡言    时间: 2013-4-28 16:00
标题: 串口助手是不是不能显示浮点型数据
串口助手上只能显示整型数据么     浮点型就变成很长的一串数据  [attach]44821[/attach]
这是串口助手的问题还是程序的问题   g_fCarSpeed=(g_nLeftCount + g_nRightCount) / 2;  f是浮点型  n是整形
printf("\n接收到 %d 个脉冲", g_fCarSpeed);   

作者: 270136977    时间: 2013-4-28 16:07
吧浮点型转化成字符串就可以显示了,不然只能16进制显示
作者: 百花园林2011    时间: 2013-4-28 16:17
*100
作者: 百花园林2011    时间: 2013-4-28 16:17

### Successful completion of Real-Time Workshop build procedure for model: untitled
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value.
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value.
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value.
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value.
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value.
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value.
Warning: The model 'untitled' does not have continuous states, hence using the solver 'VariableStepDiscrete' instead of the solver 'ode45' specified in the Configuration Parameters dialog.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be limited to be less than this value
作者: turf456    时间: 2013-4-28 16:19
我记得飞思卡尔的库里有printf的函数直接把浮点转换成带符号和小数点的字符串。可以在串口助手中直接显示小数。
作者: 沉默遇上寡言    时间: 2013-4-28 16:21
turf456 发表于 2013-4-28 16:19
我记得飞思卡尔的库里有printf的函数直接把浮点转换成带符号和小数点的字符串。可以在串口助手中直接显示小 ...

我用的就是printf

作者: 可欣    时间: 2013-4-28 17:52
怎么弄呀,同求
作者: 幽溪居士    时间: 2013-4-29 00:59
%d 加整数,改成%f 就能加浮点了




欢迎光临 智能车制作 (http://dns.znczz.com/) Powered by Discuz! X3.2