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.
Fork of PES1 by
IRSensor.h
00001 #ifndef IR_SENSOR_H_ 00002 #define IR_SENSOR_H_ 00003 00004 #include <cstdlib> 00005 #include <mbed.h> 00006 00007 /** 00008 * This is a device driver class to read the distance measured with a Sharp IR sensor. 00009 */ 00010 class IRSensor 00011 { 00012 00013 public: 00014 00015 IRSensor(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, int number); 00016 IRSensor(); 00017 00018 void init(AnalogIn* distance, DigitalOut* bit0, DigitalOut* bit1, DigitalOut* bit2, int number); 00019 virtual ~IRSensor(); 00020 float read(); 00021 00022 operator float(); 00023 00024 private: 00025 00026 AnalogIn* distance; 00027 DigitalOut* bit0; 00028 DigitalOut* bit1; 00029 DigitalOut* bit2; 00030 00031 int number; 00032 }; 00033 00034 #endif /* IR_SENSOR_H_ */
Generated on Wed Jul 20 2022 10:49:35 by
1.7.2
