智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 2736|回复: 7
打印 上一主题 下一主题

[咨询] 串口助手是不是不能显示浮点型数据

[复制链接]

77

主题

126

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1546
威望
688
贡献
268
兑换币
276
注册时间
2013-2-25
在线时间
295 小时
毕业学校
dd
跳转到指定楼层
1#
发表于 2013-4-28 16:00:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
串口助手上只能显示整型数据么     浮点型就变成很长的一串数据  
这是串口助手的问题还是程序的问题   g_fCarSpeed=(g_nLeftCount + g_nRightCount) / 2;  f是浮点型  n是整形
printf("\n接收到 %d 个脉冲", g_fCarSpeed);   

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

15

主题

277

帖子

0

精华

跨届大侠

Rank: 10Rank: 10Rank: 10

积分
6479

论坛元老奖章活跃会员奖章

QQ
威望
1282
贡献
4791
兑换币
495
注册时间
2011-10-10
在线时间
203 小时
2#
发表于 2013-4-28 16:07:22 | 只看该作者
吧浮点型转化成字符串就可以显示了,不然只能16进制显示
回复 支持 反对

使用道具 举报

45

主题

171

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1704
QQ
威望
1032
贡献
200
兑换币
353
注册时间
2012-10-1
在线时间
236 小时
3#
发表于 2013-4-28 16:17:18 | 只看该作者
*100
回复 支持 反对

使用道具 举报

45

主题

171

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1704
QQ
威望
1032
贡献
200
兑换币
353
注册时间
2012-10-1
在线时间
236 小时
4#
发表于 2013-4-28 16:17:41 | 只看该作者

### 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
回复 支持 反对

使用道具 举报

49

主题

3751

帖子

1

精华

顶级版主

Rank: 11Rank: 11Rank: 11Rank: 11

积分
27948

资源大师奖章论坛骨干奖章推广达人奖章优秀版主奖章热心会员奖章论坛元老奖章在线王奖章活跃会员奖章优秀会员奖章技术大牛奖章

威望
10632
贡献
10964
兑换币
4564
注册时间
2010-11-23
在线时间
3176 小时
5#
发表于 2013-4-28 16:19:00 | 只看该作者
我记得飞思卡尔的库里有printf的函数直接把浮点转换成带符号和小数点的字符串。可以在串口助手中直接显示小数。
回复 支持 反对

使用道具 举报

77

主题

126

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1546
威望
688
贡献
268
兑换币
276
注册时间
2013-2-25
在线时间
295 小时
毕业学校
dd
6#
 楼主| 发表于 2013-4-28 16:21:40 | 只看该作者
turf456 发表于 2013-4-28 16:19
我记得飞思卡尔的库里有printf的函数直接把浮点转换成带符号和小数点的字符串。可以在串口助手中直接显示小 ...

我用的就是printf
回复 支持 反对

使用道具 举报

68

主题

1086

帖子

0

精华

常驻嘉宾

Rank: 8Rank: 8

积分
4578

活跃会员奖章优秀会员奖章论坛元老奖章论坛骨干奖章在线王奖章

QQ
威望
2515
贡献
1213
兑换币
1382
注册时间
2012-9-19
在线时间
425 小时
7#
发表于 2013-4-28 17:52:11 | 只看该作者
怎么弄呀,同求
回复 支持 反对

使用道具 举报

1

主题

73

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
2391
威望
1218
贡献
695
兑换币
698
注册时间
2012-4-10
在线时间
239 小时
8#
发表于 2013-4-29 00:59:41 | 只看该作者
%d 加整数,改成%f 就能加浮点了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-9-22 03:45 , Processed in 0.047819 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表