#include <arpirobot/arduino/sensor/IRReflectorModule.hpp>
|
| IRReflectorModule (int digitalPin, bool createDevice=true, int deviceId=-1) |
|
| IRReflectorModule (std::string digitalPin, bool createDevice=true, int deviceId=-1) |
|
| IRReflectorModule (int digitalPin, std::string analogPin, bool createDevice=true, int deviceId=-1) |
|
| IRReflectorModule (std::string digitalPin, std::string analogPin, bool createDevice=true, int deviceId=-1) |
|
bool | getDigitalValue () |
|
int | getAnalogValue () |
|
| ArduinoDevice (bool createDevice, int deviceId) |
|
virtual std::string | getDeviceName () |
|
|
void | applyDefaultState () override |
|
std::vector< uint8_t > | getCreateData () override |
|
void | handleData (const std::vector< uint8_t > &data) override |
|
void | setArduino (BaseArduinoInterface *arduino) |
|
void | setDeviceId (int deviceId) |
|
bool | sendData (const std::vector< uint8_t > &data) |
|
bool | sendData (const std::string &data) |
|
|
static std::vector< uint8_t > | stringToData (const std::string &str) |
|
bool | createDevice |
|
int | deviceId |
|
std::string | deviceName |
|
BaseArduinoInterface * | arduino = nullptr |
|
Infrared reflection detector module
◆ IRReflectorModule() [1/4]
arpirobot::IRReflectorModule::IRReflectorModule |
( |
int |
digitalPin, |
|
|
bool |
createDevice = true , |
|
|
int |
deviceId = -1 |
|
) |
| |
- Parameters
-
digitalPin | The digital output pin for this sensor |
createDevice | Leave this true unless the device is hard-coded in arduino firmware |
deviceId | Set this to the hard-coded deviceId if createDevice is false |
◆ IRReflectorModule() [2/4]
arpirobot::IRReflectorModule::IRReflectorModule |
( |
std::string |
digitalPin, |
|
|
bool |
createDevice = true , |
|
|
int |
deviceId = -1 |
|
) |
| |
- Parameters
-
digitalPin | The digital output pin for this sensor (prefix with letter A for analog pin) |
createDevice | Leave this true unless the device is hard-coded in arduino firmware |
deviceId | Set this to the hard-coded deviceId if createDevice is false |
◆ IRReflectorModule() [3/4]
arpirobot::IRReflectorModule::IRReflectorModule |
( |
int |
digitalPin, |
|
|
std::string |
analogPin, |
|
|
bool |
createDevice = true , |
|
|
int |
deviceId = -1 |
|
) |
| |
- Parameters
-
digitalPin | The digital output pin for this sensor |
analogPin | The analog output pin for this sensor (can be prefixed with letter A, but not required) |
createDevice | Leave this true unless the device is hard-coded in arduino firmware |
deviceId | Set this to the hard-coded deviceId if createDevice is false |
◆ IRReflectorModule() [4/4]
arpirobot::IRReflectorModule::IRReflectorModule |
( |
std::string |
digitalPin, |
|
|
std::string |
analogPin, |
|
|
bool |
createDevice = true , |
|
|
int |
deviceId = -1 |
|
) |
| |
- Parameters
-
digitalPin | The digital output pin for this sensor (prefix with letter A for analog pin) |
analogPin | The analog output pin for this sensor (can be prefixed with letter A, but not required) |
createDevice | Leave this true unless the device is hard-coded in arduino firmware |
deviceId | Set this to the hard-coded deviceId if createDevice is false |
◆ getAnalogValue()
int arpirobot::IRReflectorModule::getAnalogValue |
( |
| ) |
|
Get the analog reflection signal strength (if this device was setup to use an analog input)
- Returns
- The read analog value (will be zero if not configured for analog data)
◆ getDigitalValue()
bool arpirobot::IRReflectorModule::getDigitalValue |
( |
| ) |
|
Get the digital value read from the sensor
- Returns
- true or false. One cooresponds to reflection detected. The other is no reflection detected.
The documentation for this class was generated from the following file: