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.
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 operator float(); 00025 00026 private: 00027 00028 AnalogIn& distance; 00029 DigitalOut& bit0; 00030 DigitalOut& bit1; 00031 DigitalOut& bit2; 00032 int number; 00033 }; 00034 00035 #endif /* IR_SENSOR_H_ */ 00036
Generated on Sat Jul 23 2022 17:01:00 by
