From a11e81609c018d695faec58849b9f91d35b2b522 Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Tue, 20 May 2008 21:39:54 +0200 Subject: Compute the position of the obstacle on the value returned by the sharps. --- digital/io/src/sharp.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'digital/io/src/sharp.h') 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. -- cgit v1.2.3