sef
Dependencies: mbed
Fork of Bewegungen_mit_Sensor by
Diff: IRSensor.h
- Revision:
- 1:d40ff07e2fe0
- Parent:
- 0:96f88638114b
- Child:
- 2:365bf16abbf6
diff -r 96f88638114b -r d40ff07e2fe0 IRSensor.h --- a/IRSensor.h Tue Mar 21 14:57:54 2017 +0000 +++ b/IRSensor.h Wed May 10 09:14:12 2017 +0000 @@ -1,40 +1,25 @@ -/* - * IRSensor.h - * Copyright (c) 2016, ZHAW - * All rights reserved. - */ - -#ifndef IR_SENSOR_H_ -#define IR_SENSOR_H_ +#ifndef IR_SENSOR_H +#define IR_SENSOR_H -#include <cstdlib> -#include <mbed.h> +#include "mbed.h" -/** - * This is a device driver class to read the distance measured with a Sharp IR sensor. - */ -class IRSensor -{ +//E. Hess +//IRSensor.h -public: - - IRSensor(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, int number); - IRSensor(); - - void init(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, int number); - virtual ~IRSensor(); - float read(); +class IRSensor { + public: + IRSensor(); + IRSensor(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, int number); + ~IRSensor(); + void init(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, int number); + float read(); - operator float(); - -private: - - AnalogIn* distance; - DigitalOut* bit0; - DigitalOut* bit1; - DigitalOut* bit2; - - int number; + private: + AnalogIn* distance; + DigitalOut* bit0; + DigitalOut* bit1; + DigitalOut* bit2; + int number; }; -#endif /* IR_SENSOR_H_ */ +#endif \ No newline at end of file