有人请求帮助cy8ckit-042,我决定离开我的cy8ckit-044版本在这里。
这是有点实惠HC-SR04超声波传感器模块,看起来简单,但对模块的芯片做的很好的工作!
首先,我设置定时器的时钟频率为10MHz,所以计算很简单,
但随着24MHz时钟源,误差是相当大的,最终我有测量
在2CM左右为cy8ckit-042 cy8ckit-044 4cm误差。
然后从lukebartol三暗示,我改变定时器的时钟频率为12MHz
这样的时钟误差是非常小的,和我有小于1cm的误差(S)为cy8ckit-044
以及CY8CKIT-042。
最后但并非最不重要的,当模块需要5V操作,我们需要设置J9 2-3 1-2。
摩托罗拉
ultrasonic180715.cyprj.archive01.zip
553.8 K
以上来自于百度翻译
以下为原文
As someone asked for help with CY8CKIT-042, I decided to leave my CY8CKIT-044 version here.
This HC-SR04 sensor module is somewhat affordable and looks simple, but the ICs on the module do nice job!
At first, I set the
timer Clock Frequency to 10MHz, so that the calculation would be simple,
but with the 24MHz source clock, the error is rather large and I ended up to have measurement
errors around 2cm for CY8CKIT-044 and 4cm for CY8CKIT-042.
Then Considering the hint from lukebartol-san, I changed the Timer Clock Frequency to 12MHz
so that the clock error is much smaller, and I got less than 1cm error(s) for both CY8CKIT-044
and CY8CKIT-042.
Last but not least, as the module requires 5V operation, we need to set J9 to 2-3 from 1-2.
moto