upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
GUVAS12D Class Reference

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

Detailed Description

UPM module for the GUVA-S12D UV sensor

guvas12d.jpg
// The was tested with the Grove UV Sensor module.
// It has a sensing range from between 200-400nm. It's strongest
// response is around 320-360nm.
// Instantiate a GUVAS12D on analog pin A0
upm::GUVAS12D *volts = new upm::GUVAS12D(0);
// The higher the voltage the more intense the UV radiation.
while (shouldRun)
{
cout << "AREF: " << GUVAS12D_AREF
<< ", Voltage value (higher means more UV): "
<< volts->value(GUVAS12D_AREF, SAMPLES_PER_QUERY) << endl;
sleep(1);
}

Public Member Functions

 GUVAS12D (int pin)
 
 ~GUVAS12D ()
 
float value (float aref, unsigned int samples)
 

Constructor & Destructor Documentation

GUVAS12D ( int  pin)

GUVA-S12D UV sensor constructor

Parameters
pinAnalog pin to use
~GUVAS12D ( )

GUVAS12D destructor

Member Function Documentation

float value ( float  aref,
unsigned int  samples 
)

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
Returns
Average voltage reading

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