summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/sharp.h
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-05-20 21:39:54 +0200
committerNélio Laranjeiro2008-05-20 21:39:54 +0200
commita11e81609c018d695faec58849b9f91d35b2b522 (patch)
treeb2666637b997ec70b377ff54514f0f0b095e02c5 /digital/io/src/sharp.h
parentd8d05fbbbd925d37fe846be91715d57ef5c19d21 (diff)
Compute the position of the obstacle on the value returned by the sharps.
Diffstat (limited to 'digital/io/src/sharp.h')
-rw-r--r--digital/io/src/sharp.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/digital/io/src/sharp.h b/digital/io/src/sharp.h
index 3011e095..537208cd 100644
--- a/digital/io/src/sharp.h
+++ b/digital/io/src/sharp.h
@@ -65,6 +65,9 @@
*/
#define SHARP_BACK_RIGHT 4
+/** Sharps conversion table number of elements. */
+#define SHARP_NB_ELEMENT_TABLE_CONV 12
+
/**
* Low (0 index) and high (1 index) thresholds for interpreted sharp values.
*/
@@ -91,6 +94,15 @@ void sharp_update (uint8_t sharp_mask);
*/
uint16_t sharp_get_raw (uint8_t sharp_id);
+/**
+ * Get the distance of the sharp computed on the value. It does a search in the
+ * table.
+ * @param sharp_value the value of the seen by the sharp.
+ * @return the value in mm of the object seen.
+ */
+uint16_t
+sharp_get_distance_mm (uint16_t sharp_value);
+
/**
* Configure the thresholds of a sharp.
* @param sharp_id the sharp id to configure the thresholds.