< Khepera III Toolbox < The Toolbox < Modules

The measurement module provides a common framework for all programs which solely read a sensor (or several sensors) and report the result. Programs using this module therefore accept the same command line options to specify

  • the interval between two measurements (-w US)
  • the number of measurements to be taken (-r N or just -r for continuous measurements)
  • whether to print the results
    • right after measuring (default)
    • at the end (-f)
    • not at all (-F)

Synopsis

Check out the source code of the battery program for an example.

Description

This module controls the main program flow and requires only two hook functions:

  • A hook function take one measurement (hook_measure)
  • A hook function to print one measurement (hook_print)

Furthermore, an array for storing intermediate measurement must be provided.

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.