ROME_P5

Dependencies:   mbed

Committer:
Inaueadr
Date:
Fri Apr 27 08:47:34 2018 +0000
Revision:
0:29be10cb0afc
Hallo

Who changed what in which revision?

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