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: mbed
IRSensor.h
00001 /* 00002 * IRSensor.h 00003 * Copyright (c) 2018, 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 is a device driver class to read the distance measured with a Sharp IR sensor. 00015 */ 00016 class IRSensor { 00017 00018 public: 00019 00020 IRSensor(AnalogIn& distance, DigitalOut& bit0, DigitalOut& bit1, DigitalOut& bit2, int number); 00021 virtual ~IRSensor(); 00022 float read(); 00023 operator float(); 00024 00025 private: 00026 00027 AnalogIn& distance; 00028 DigitalOut& bit0; 00029 DigitalOut& bit1; 00030 DigitalOut& bit2; 00031 00032 int number; 00033 }; 00034 00035 #endif /* IR_SENSOR_H_ */ 00036 00037
Generated on Thu Jul 14 2022 09:49:36 by
