| RTOS_MSPM0 1.1 ECE445M starter code

Functions
IRDistance.h File Reference

Take infrared distance measurements. More...

`#include <stdint.h>`

Go to the source code of this file.

## Functions
int32_t | IRDistance_Convert (int32_t adcSample, uint32_t sensor)
| Convert infrared distance measurement. More...

## Detailed Description

Take infrared distance measurements.

Provide mid-level functions that convert raw ADC values from the GP2Y0A21YK0F infrared distance sensors to distances in mm.

Version
  derived from TI-RSLK MAX v1.1

Author
  Daniel Valvano and Jonathan Valvano

Copyright
  Copyright 2020 by Jonathan W. Valvano, valva.nosp@m.no@m.nosp@m.ail.u.nosp@m.texa.nosp@m.s.edu,

Warning
  AS-IS

Note
  For more information see http://users.ece.utexas.edu/~valvano/

Date
  January 15, 2020

## Function Documentation

## ◆ IRDistance_Convert()

int32_t IRDistance_Convert | ( | int32_t | adcSample,
|  | uint32_t | sensor
| ) |  |

Convert infrared distance measurement.

Convert ADC sample into distance for the GP2Y0A21YK0F infrared distance sensor. Conversion uses a calibration formula
D = A/(adcSample + B) + C

Parameters

  adcSample | is the 12-bit ADC sample 0 to 4095
  sensor | is sensor number 0 to 3

Returns
  distance from robot to wall (units mm)