upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the GUVA-S12D UV Sensor. More...

Detailed Description

UPM module for the GUVA-S12D UV sensor

guvas12d.jpg
// This was tested with the Grove UV Sensor module.
// It has a sensing range from between 240-370nm. It's strongest
// response is around 320-360nm.
// Instantiate a GUVAS12D on analog pin A0
// The higher the voltage the more intense the UV radiation.
while (shouldRun) {
cout << "Volts: " << volts.volts() << ", Intensity: " << volts.intensity() << " mW/m^2"
<< endl;
upm_delay(1);
}

Public Member Functions

 GUVAS12D (int pin, float aref=5.0)
 
 ~GUVAS12D ()
 
float value (float aref, unsigned int samples)
 
float volts ()
 
float intensity ()
 
void setScale (float scale)
 
void setOffset (float offset)
 

Constructor & Destructor Documentation

GUVAS12D ( int  pin,
float  aref = 5.0 
)

GUVA-S12D UV sensor constructor

Parameters
pinAnalog pin to use
arefAnalog reference voltage to use
~GUVAS12D ( )

GUVAS12D destructor

Here is the call graph for this function:

Member Function Documentation

float value ( float  aref,
unsigned int  samples 
)
Deprecated:
This method is being replaced by the volts() and illumination() methods.

Gets the average voltage value from the sensor

Parameters
arefReference voltage in use (usually 5.0 V or 3.3 V)
samplesNumber of samples to average over (currently ignored)
Returns
Average voltage reading

Here is the call graph for this function:

float volts ( )

Gets the voltage value from the sensor

Returns
Voltage reading

Here is the call graph for this function:

Here is the caller graph for this function:

float intensity ( )

Gets the computed illumination intensity from the sensor in mW/m^2.

Returns
Intensity over the sensitive wavelengths in mW/m^2

Here is the call graph for this function:

void setScale ( float  scale)

Set sensor scale. This scale is applied to the intensity value before the offset is applied. Default is 1.0.

Parameters
scaleScale to apply.

Here is the call graph for this function:

void setOffset ( float  offset)

Set sensor offset. This offset is applied to the intensity value before scaling. Default is 0.0.

Parameters
offsetOffset to apply.

Here is the call graph for this function:


The documentation for this class was generated from the following files: