Libreria para usar sensor MaxSonar EZ01 con PulseWidth
MaxSonar.h@0:de1c628c1495, 2014-03-27 (annotated)
- Committer:
- migool
- Date:
- Thu Mar 27 23:29:50 2014 +0000
- Revision:
- 0:de1c628c1495
Libreria para usar Sensor MaxSonar EZ01 con PulseWidth
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
migool | 0:de1c628c1495 | 1 | #ifndef MBED_MAXSONAR_H |
migool | 0:de1c628c1495 | 2 | #define MBED_MAXSONAR_H |
migool | 0:de1c628c1495 | 3 | |
migool | 0:de1c628c1495 | 4 | #include "mbed.h" |
migool | 0:de1c628c1495 | 5 | |
migool | 0:de1c628c1495 | 6 | class MaxSonar{ |
migool | 0:de1c628c1495 | 7 | public: |
migool | 0:de1c628c1495 | 8 | MaxSonar(PinName pin); |
migool | 0:de1c628c1495 | 9 | float getinches(); |
migool | 0:de1c628c1495 | 10 | float getcm(); |
migool | 0:de1c628c1495 | 11 | private: |
migool | 0:de1c628c1495 | 12 | InterruptIn _pin; |
migool | 0:de1c628c1495 | 13 | void up(); |
migool | 0:de1c628c1495 | 14 | void down(); |
migool | 0:de1c628c1495 | 15 | float pulse(); |
migool | 0:de1c628c1495 | 16 | }; |
migool | 0:de1c628c1495 | 17 | |
migool | 0:de1c628c1495 | 18 | #endif |