Difference between revisions of "Component: Ultrasonic (EBM019) (EBM Modules)"
Line 62: | Line 62: | ||
{{Fcfile|EBM019 - Test Program.fcfx|EBM019 Example}} | {{Fcfile|EBM019 - Test Program.fcfx|EBM019 Example}} | ||
+ | |||
+ | |||
Line 68: | Line 70: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===GetDistance=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 81: | Line 84: | ||
+ | ===SetDelayTime=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 99: | Line 103: | ||
+ | ===SetDetectionValue=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 117: | Line 122: | ||
+ | ===SetPulseWidth=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 135: | Line 141: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:49, 3 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | EBM Modules |
Contents
Ultrasonic component
This board has both an ultrasonic transmitter and receiver. The transmitter is driven by an on-board 40KHz oscillator which is enabled by the host microprocessor. The receiving sensor signal is amplified and provided as an analogue signal to be processed by a single channel ADC of the microprocessor. By measuring the time delay between enabling a transmit pulse and receiving an echo the distance of objects in a range of around 3cm to 3m can be determined.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_EBM019v1.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_EBM019v1.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Sample program using the EBM019 - Ultrasonic sensor.
Sends out a pulse and determines distance from time taken to receive reflection.
Macro reference
GetDistance
![]() |
GetDistance |
Sends a pulse and processes the echo. Returns a object distance in cm | |
![]() |
Return |
SetDelayTime
![]() |
SetDelayTime |
Set the delay time before sampling for the echo, in microseconds | |
![]() |
delay |
delay time in microseconds | |
![]() |
Return |
SetDetectionValue
![]() |
SetDetectionValue |
Set the delta value for echo detection | |
![]() |
value |
trigger point for echo detection | |
![]() |
Return |
SetPulseWidth
![]() |
SetPulseWidth |
Set the output pulse width, in microsecond (0-255uS) | |
![]() |
pulse |
width of pulse in microseconds | |
![]() |
Return |
Initialise
![]() |
Initialise |
Setup the device. This sets the control output to logic 0 | |
![]() |
Return |