P1

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IRSensor.h Source File

IRSensor.h

00001 /*
00002  * IRSensor.h
00003  * Copyright (c) 2020, ZHAW
00004  * All rights reserved.
00005  */
00006 
00007 #ifndef IR_SENSOR_H_
00008 #define IR_SENSOR_H_
00009 
00010 #include <cstdlib>
00011 #include <mbed.h>
00012 
00013 /**
00014  * This class implements a driver to read the distance sensors
00015  * of the ROME2 mobile robot.
00016  */
00017 class IRSensor {
00018 
00019     public:
00020         
00021                 IRSensor(AnalogIn& distance, DigitalOut& bit0, DigitalOut& bit1, DigitalOut& bit2, int number);
00022         virtual ~IRSensor();
00023         float   read();
00024         
00025     private:
00026         
00027         AnalogIn&   distance;
00028         DigitalOut& bit0;
00029         DigitalOut& bit1;
00030         DigitalOut& bit2;
00031         int         number;
00032 };
00033 
00034 #endif /* IR_SENSOR_H_ */
00035