Charge sensor.
I2C interface for University of Reading charge sensor
Example for airframe file
Add to your firmware section:
<module name="charge_sens"/>
Module functions
Init Functions
These initialization functions are called once on startup.
Event Functions
These event functions are called in each cycle of the module event loop.
Periodic Functions
These functions are called periodically at the specified frequency from the module periodic loop.
- charge_sens_periodic()
- Frequency in Hz: 10
- 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 charge_sens.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="charge_sens" dir="meteo">
<doc>
<description>
Charge sensor.
I2C interface for University of Reading charge sensor
</description>
</doc>
<header>
<file name="charge_sens.h"/>
</header>
<init fun="charge_sens_init()"/>
<periodic fun="charge_sens_periodic()" freq="10"/>
<event fun="charge_sens_event()"/>
<makefile target="ap">
<file name="charge_sens.c"/>
<test>
<define name="USE_I2C0"/>
<define name="DOWNLINK_TRANSPORT" value="pprz_tp"/>
<define name="DOWNLINK_DEVICE" value="uart0"/>
<define name="USE_UART0"/>
</test>
</makefile>
</module>