Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Sonar ADC driver

Module XML file: sonar_adc.xml

Reads an anlog sonar sensor and outputs sonar distance in [m]

Module configuration options

Configure Options

  • name: ADC_SONAR value: ADC_X
    Description: select ADC to use with the sonar

Define Options

  • name: SONAR_OFFSET value: 0.0
    Description: sensor offset in [m] - default is 0.0
  • name: SONAR_SCALE value: 0.0166
    Description: sensor scale factor [m/adc] - default is 0.0166

Module functions

Init Functions

These initialization functions are called once on startup.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

  • sonar_adc_read()
    • Frequency in Hz: 10
    • Autorun: LOCK
      Periodic function automatically starts after init and can't be stopped.


Header Files

The following headers are automatically included in modules.h

Source Files

Raw sonar_adc.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="sonar">
Sonar ADC driver.
Reads an anlog sonar sensor and outputs sonar distance in [m]
<configure name="ADC_SONAR" value="ADC_X" description="select ADC to use with the sonar"/>
<define name="SONAR_OFFSET" value="0.0" description="sensor offset in [m] - default is 0.0"/>
<define name="SONAR_SCALE" value="0.0166" description="sensor scale factor [m/adc] - default is 0.0166"/>
<file name="sonar_adc.h"/>
<init fun="sonar_adc_init()"/>
<periodic fun="sonar_adc_read()" freq="10"/>
<file name="sonar_adc.c"/>
<makefile target="ap">
<define name="ADC_CHANNEL_SONAR" value="$(ADC_SONAR)"/>
<define name="USE_$(ADC_SONAR)"/>
<define name="USE_SONAR"/>