Difference between revisions of "Component: Ultrasonic Ranger (Grove 101020010) (101020010) (Audio)"

From Flowcode Help
Jump to navigationJump to search
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Ultrasonic_Ranger.fcfx FC_Comp_Source_Ultrasonic_Ranger.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Ultrasonic_Ranger.fcfx FC_Comp_Source_Ultrasonic_Ranger.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Ultrasonic_Ranger.fcfx FC_Comp_Source_Ultrasonic_Ranger.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 40: Line 44:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 64: Line 70:
  
 
==Macro reference==
 
==Macro reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForEcho'''
 +
|-
 +
| colspan="2" | Waits until the echo has been received from the Ping macro allowing you to perform your own timing. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MeasureDistance'''
 +
|-
 +
| colspan="2" | Converts a micro second time from the ultrasonic range sensor and returns the range in mm, cm or inches. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | TimeDelay
 +
|-
 +
| colspan="2" | Microsecond reading from Ultrasound module 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Scale
 +
|-
 +
| colspan="2" | 0=MM / 1=CM / 2=Inch 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Ping'''
 +
|-
 +
| colspan="2" | 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. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleSensor'''
 +
|-
 +
| colspan="2" | 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. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
 +
 +
==Property reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | Control Pin
 +
|-
 +
| colspan="2" | Pin connected to the emitter of the sensor. 
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Measurement
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Time Measurement
 +
|-
 +
| colspan="2" | 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. 
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Timer Properties
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Timer
 +
|-
 +
| colspan="2" | Timer Peripheral to use to monitor the passage of time. 
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 +
| width="90%" | Discrete Distance
 +
|-
 +
| colspan="2" | Simulation range used to determine if the sense pin is active or not. 
 +
|}==Macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 15:25, 20 January 2023

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

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


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


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


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



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. 

==Macro reference==

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


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


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


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



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. 

==Macro reference==

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


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


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


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



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.