13年8个月前IP:未同步
518940
10楼
吐槽一下,LZ的C代码,和Arduino全C++的库格格不入。

Playground的NewPing库
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Methods

sonar.ping(); - Send a ping, returns the echo time in microseconds or 0 (zero) if no ping echo within set distance limit
sonar.ping_in(); - Send a ping, returns the distance in inches or 0 (zero) if no ping echo within set distance limit
sonar.ping_cm(); - Send a ping, returns the distance in centimeters or 0 (zero) if no ping echo within set distance limit
sonar.ping_median(iterations); - Do multiple pings (default=5), discard out of range pings and return median in microseconds
sonar.convert_in(echoTime); - Converts microseconds to distance in inches
sonar.convert_cm(echoTime); - Converts microseconds to distance in centimeters
sonar.ping_timer(function); - Send a ping and call function to test if ping is complete.
sonar.check_timer(); - Check if ping has returned within the set distance limit.
timer_us(frequency, function); - Call function every frequency microseconds.
timer_ms(frequency, function); - Call function every frequency milliseconds.
timer_stop(); - Stop the timer.
评论
文号 / 518940

万流景仰
名片发私信
学术分 12
总主题 379 帖总回复 8283 楼拥有证书:进士 学者 机友
注册于 2008/10/11 20:04:00最后登录 2026/10/12 22:44:46
主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:0

个人简介

Cubesat

笔记
{{note.content}}
{{n.user.username}}
{{fromNow(n.toc)}} {{n.status === noteStatus.disabled ? "已屏蔽" : ""}} {{n.status === noteStatus.unknown ? "正在审核" : ""}} {{n.status === noteStatus.deleted ? '已删除' : ''}}
  • 编辑
  • 删除
  • {{n.status === 'disabled' ? "解除屏蔽" : "屏蔽" }}
我也是有底线的