Component: Ultrasonic Ranger (Grove 101020010) (101020010) (Audio)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd
Version 1.0
Category Audio


Ultrasonic Ranger (Grove 101020010) component

The ultrasonic sensor is a non-contact distance measurement module. It's designed for easy modular project usage with industrial performance. Detecting range: 3cm to 4m, best in 30 degree angle.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Ultrasonic_Ranger.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Ultrasonic_Ranger.fcfx

Detailed description

No detailed description exists yet for this component

Examples

This example performs an ultrasonic range sample and then converts the sample from a timing into a measurement in millimetres.

FC6 Icon.png UltraSound Test






Macro reference

MeasureDistance

Fc9-comp-macro.png MeasureDistance
Converts a micro second time from the ultrasonic range sensor and returns the range in mm, cm or inches. 
Fc9-u16-icon.png - UINT TimeDelay
Microsecond reading from Ultrasound module 
Fc9-u8-icon.png - BYTE Scale
0=MM / 1=CM / 2=Inch 
Fc9-u16-icon.png - UINT Return


Ping

Fc9-comp-macro.png Ping
Performs a transmit ping allowing you to monitor the incoming signal and perform your own timings maybe using a rising edge interrupt and a timer. 
Fc9-void-icon.png - VOID Return


SampleSensor

Fc9-comp-macro.png SampleSensor
Sends out an ultrasonic ping and times how long it takes to receive the echo. Returns the time in microseconds. Performs the timing using software so depending on the speed of the micro will be an approximation. For better results use the Ping macro. 
Fc9-u16-icon.png - UINT Return


WaitForEcho

Fc9-comp-macro.png WaitForEcho
Waits until the echo has been received from the Ping macro allowing you to perform your own timing. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Control Pin
Pin connected to the emitter of the sensor. 
Fc9-conn-icon.png Measurement
Fc9-type-16-icon.png Time Measurement
Controls how the sensors ultrasonic ping is timed, Either using single microsecond delays or using timer hardware. On slower devices e.g. PIC it is advisable to use the Timer method. 
Fc9-conn-icon.png Timer Properties
Fc9-type-16-icon.png Timer
Timer Peripheral to use to monitor the passage of time. 
Fc9-conn-icon.png Simulation
Fc9-type-15-icon.png Discrete Distance
Simulation range used to determine if the sense pin is active or not.