Makeblock-library-for-Arduino  V3.2.4
It's a library for arduino application developers
MeUltrasonicSensor.h
Go to the documentation of this file.
1 
53 #ifndef MeUltrasonicSensor_H
54 #define MeUltrasonicSensor_H
55 
56 #include <stdint.h>
57 #include <stdbool.h>
58 #include <Arduino.h>
59 #include "MeConfig.h"
60 
61 #ifdef ME_PORT_DEFINED
62 #include "MePort.h"
63 #endif // ME_PORT_DEFINED
64 
70 #ifndef ME_PORT_DEFINED
72 #else // !ME_PORT_DEFINED
73 class MeUltrasonicSensor : public MePort
74 #endif // !ME_PORT_DEFINED
75 {
76 public:
77 #ifdef ME_PORT_DEFINED
78 
84  MeUltrasonicSensor(void);
85 
91  MeUltrasonicSensor(uint8_t port);
92 #else // ME_PORT_DEFINED
93 
99  MeUltrasonicSensor(uint8_t port);
100 #endif // ME_PORT_DEFINED
101 
116  void setpin(uint8_t SignalPin);
117 
132  double distanceCm(uint16_t = 400);
133 
148  double distanceInch(uint16_t = 180);
149 
165  long measure(unsigned long = 30000);
166 private:
167  volatile uint8_t _SignalPin;
168  volatile bool _measureFlag;
169  volatile long _lastEnterTime;
170  volatile float _measureValue;
171 };
172 
173 #endif
174 
void setpin(uint8_t SignalPin)
Definition: MeUltrasonicSensor.cpp:97
Configuration file of library.
double distanceInch(uint16_t=180)
Definition: MeUltrasonicSensor.cpp:146
Driver for Me ultrasonic sensor device.
Definition: MeUltrasonicSensor.h:73
Port Mapping for RJ25.
Definition: MePort.h:118
MeUltrasonicSensor(void)
Definition: MeUltrasonicSensor.cpp:53
double distanceCm(uint16_t=400)
Definition: MeUltrasonicSensor.cpp:122
long measure(unsigned long=30000)
Definition: MeUltrasonicSensor.cpp:171
Header for MePort.cpp module.