Difference between revisions of "Component: Ultrasonic (HCSR04) (Audio)"

From Flowcode Help
Jump to navigationJump to search
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 24: Line 26:
  
 
==Examples==
 
==Examples==
 +
 +
  
  

Revision as of 13:30, 17 November 2021

Author Matrix TSL
Version 1.0
Category Audio


Ultrasonic component

This board has both an ultrasonic transmitter and receiver. When the Trig pin is set high for 10uS, the transmitter sends eight 40KHz pulses. The Echo pin goes high about 2ms later. The duration of the Echo pin is measure when it goes high, and a distance is then calculated based on the high duration. The distance of objects in a range of around 3cm to 2.75m can be determined.

Detailed description

No detailed description exists yet for this component

Examples

FC6 Icon.png HC-SR04 Distance Sensor Demo.fcfx

Downloadable macro reference

Fc9-comp-macro.png GetDistance
Sends a pulse and processes the echo. Returns a object distance in cm 
Fc9-u16-icon.png - UINT Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-5-icon.png OutputTrig Pin
Pin used for controlling the output pulse 
Fc9-type-5-icon.png Input Echo Pin
ADC channel used to monitor the echo 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations