| RTOS_MSPM0 1.1 ECE445M starter code

IRDistance.h
Go to the documentation of this file.
1
16 /* This example accompanies the book
17 "Embedded Systems: Introduction to Robotics,
18 Jonathan W. Valvano, ISBN: 9781074544300, copyright (c) 2020
19 For more information about my classes, my research, and my books, see
20 http://users.ece.utexas.edu/~valvano/
21
22 Simplified BSD License (FreeBSD License)
23 Copyright (c) 2020, Jonathan Valvano, All rights reserved.
24
25 Redistribution and use in source and binary forms, with or without modification,
26 are permitted provided that the following conditions are met:
27
28 1. Redistributions of source code must retain the above copyright notice,
29 this list of conditions and the following disclaimer.
30 2. Redistributions in binary form must reproduce the above copyright notice,
31 this list of conditions and the following disclaimer in the documentation
32 and/or other materials provided with the distribution.
33
34 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
38 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
41 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
42 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
43 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
45 The views and conclusions contained in the software and documentation are
46 those of the authors and should not be interpreted as representing official
47 policies, either expressed or implied, of the FreeBSD Project.
48 */
49
50 // 5V connected to all GP2Y0A21YK0F Vcc's (+5V)
51 // 5V connected to positive side of 10 uF capacitors physically near the sensors
52 // ground connected to all GP2Y0A21YK0F grounds and microcontroller ground
53 // ground connected to negative side of all 10 uF capacitors
54
55
56
57 #ifndef IRDISTANCE_H_
58 #define IRDISTANCE_H_
59 #include <stdint.h>
60
70 int32_t IRDistance_Convert(int32_t adcSample, uint32_t sensor);
71
72
73 #endif /* IRDISTANCE_H_ */
IRDistance_Convert
int32_t IRDistance_Convert(int32_t adcSample, uint32_t sensor)
Convert infrared distance measurement.