Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
humid_sht module

SHTxx humidity sensor.

This reads the values for humidity and temperature from the SHTxx sensor through bit banging.

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

<module name="humid_sht">
b'<define name="SHT_DAT_GPIO" value="port,pin" />\n '
b'<define name="SHT_SCK_GPIO" value="port,pin" />\n '
b'<define name="SHT_SDLOG" value="TRUE|FALSE" />\n '
</module>

Module configuration options

Define Options

  • name: SHT_DAT_GPIO value: port,pin
    Description: data GPIO (e.g.: GPIOA,GPIO8)
  • name: SHT_SCK_GPIO value: port,pin
    Description: clock GPIO (e.g.: GPIOA,GPIO9)
  • name: SHT_SDLOG value: TRUE|FALSE
    Description: start logging to SD card

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.

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

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw humid_sht.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="humid_sht" dir="meteo">
<doc>
<description>
SHTxx humidity sensor.
This reads the values for humidity and temperature from the SHTxx sensor through bit banging.
</description>
<define name="SHT_DAT_GPIO" value="port,pin" description="data GPIO (e.g.: GPIOA,GPIO8)"/>
<define name="SHT_SCK_GPIO" value="port,pin" description="clock GPIO (e.g.: GPIOA,GPIO9)"/>
<define name="SHT_SDLOG" value="TRUE|FALSE" description="start logging to SD card"/>
</doc>
<header>
<file name="humid_sht.h"/>
</header>
<init fun="humid_sht_init()"/>
<periodic fun="humid_sht_periodic()" freq="4."/>
<makefile target="ap">
<file name="humid_sht.c"/>
</makefile>
</module>