Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: PM2_Libary Eigen
IRSensor.h@41:7484471403aa, 2022-05-11 (annotated)
- Committer:
- pmic
- Date:
- Wed May 11 09:44:25 2022 +0200
- Revision:
- 41:7484471403aa
- Parent:
- 40:924bdbc33391
- Child:
- 42:d2d2db5974c9
Delete StateMachine
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pmic | 37:698d6b73b50c | 1 | /* |
| pmic | 37:698d6b73b50c | 2 | * IRSensor.h |
| pmic | 37:698d6b73b50c | 3 | * Copyright (c) 2022, ZHAW |
| pmic | 37:698d6b73b50c | 4 | * All rights reserved. |
| pmic | 37:698d6b73b50c | 5 | */ |
| pmic | 37:698d6b73b50c | 6 | |
| pmic | 37:698d6b73b50c | 7 | #ifndef IR_SENSOR_H_ |
| pmic | 37:698d6b73b50c | 8 | #define IR_SENSOR_H_ |
| pmic | 37:698d6b73b50c | 9 | |
| pmic | 37:698d6b73b50c | 10 | #include <cstdlib> |
| pmic | 37:698d6b73b50c | 11 | #include <mbed.h> |
| pmic | 37:698d6b73b50c | 12 | |
| pmic | 37:698d6b73b50c | 13 | /** |
| pmic | 37:698d6b73b50c | 14 | * This class implements a driver to read the distance sensors |
| pmic | 37:698d6b73b50c | 15 | * of the ROME2 mobile robot. |
| pmic | 37:698d6b73b50c | 16 | */ |
| pmic | 37:698d6b73b50c | 17 | class IRSensor { |
| pmic | 37:698d6b73b50c | 18 | |
| pmic | 37:698d6b73b50c | 19 | public: |
| pmic | 37:698d6b73b50c | 20 | |
| pmic | 37:698d6b73b50c | 21 | IRSensor(AnalogIn& distance, DigitalOut& bit0, DigitalOut& bit1, DigitalOut& bit2, int number); |
| pmic | 37:698d6b73b50c | 22 | virtual ~IRSensor(); |
| pmic | 37:698d6b73b50c | 23 | float read(); |
| pmic | 40:924bdbc33391 | 24 | // operator float(); |
| pmic | 37:698d6b73b50c | 25 | |
| pmic | 37:698d6b73b50c | 26 | private: |
| pmic | 37:698d6b73b50c | 27 | |
| pmic | 37:698d6b73b50c | 28 | AnalogIn& distance; |
| pmic | 37:698d6b73b50c | 29 | DigitalOut& bit0; |
| pmic | 37:698d6b73b50c | 30 | DigitalOut& bit1; |
| pmic | 37:698d6b73b50c | 31 | DigitalOut& bit2; |
| pmic | 37:698d6b73b50c | 32 | int number; |
| pmic | 37:698d6b73b50c | 33 | }; |
| pmic | 37:698d6b73b50c | 34 | |
| pmic | 37:698d6b73b50c | 35 | #endif /* IR_SENSOR_H_ */ |
