rome2_p6 imported

Dependencies:   mbed

Committer:
Appalco
Date:
Fri May 18 13:54:25 2018 +0000
Revision:
5:957580f33e52
Parent:
0:351a2fb21235
fixed tolerance and wayponts

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Appalco 0:351a2fb21235 1 /*
Appalco 0:351a2fb21235 2 * IRSensor.h
Appalco 0:351a2fb21235 3 * Copyright (c) 2018, ZHAW
Appalco 0:351a2fb21235 4 * All rights reserved.
Appalco 0:351a2fb21235 5 */
Appalco 0:351a2fb21235 6
Appalco 0:351a2fb21235 7 #ifndef IR_SENSOR_H_
Appalco 0:351a2fb21235 8 #define IR_SENSOR_H_
Appalco 0:351a2fb21235 9
Appalco 0:351a2fb21235 10 #include <cstdlib>
Appalco 0:351a2fb21235 11 #include <mbed.h>
Appalco 0:351a2fb21235 12
Appalco 0:351a2fb21235 13 /**
Appalco 0:351a2fb21235 14 * This is a device driver class to read the distance measured with a Sharp IR sensor.
Appalco 0:351a2fb21235 15 */
Appalco 0:351a2fb21235 16 class IRSensor {
Appalco 0:351a2fb21235 17
Appalco 0:351a2fb21235 18 public:
Appalco 0:351a2fb21235 19
Appalco 0:351a2fb21235 20 IRSensor(AnalogIn& distance, DigitalOut& bit0, DigitalOut& bit1, DigitalOut& bit2, int number);
Appalco 0:351a2fb21235 21 virtual ~IRSensor();
Appalco 0:351a2fb21235 22 float read();
Appalco 0:351a2fb21235 23 operator float();
Appalco 0:351a2fb21235 24
Appalco 0:351a2fb21235 25 private:
Appalco 0:351a2fb21235 26
Appalco 0:351a2fb21235 27 AnalogIn& distance;
Appalco 0:351a2fb21235 28 DigitalOut& bit0;
Appalco 0:351a2fb21235 29 DigitalOut& bit1;
Appalco 0:351a2fb21235 30 DigitalOut& bit2;
Appalco 0:351a2fb21235 31
Appalco 0:351a2fb21235 32 int number;
Appalco 0:351a2fb21235 33 };
Appalco 0:351a2fb21235 34
Appalco 0:351a2fb21235 35 #endif /* IR_SENSOR_H_ */
Appalco 0:351a2fb21235 36
Appalco 0:351a2fb21235 37