The Grove – UV Sensor is used for detecting the intensity of incident ultraviolet(UV) radiation. This form of electromagnetic radiation has shorter wavelengths than visible radiation. The Grove - UV Sensor is based on the sensor GUVA-S12D which has a wide spectral range of 200nm-400nm. The module outputs electrical signal which varies with the UV intensity.
Dependencies: mbed
Fork of Seeed_Grove_UV_Sensor_Example by
main.cpp@0:26a3a6edbb11, 2014-09-05 (annotated)
- Committer:
- mbedAustin
- Date:
- Fri Sep 05 03:00:54 2014 +0000
- Revision:
- 0:26a3a6edbb11
Seeed Grove UV Sensor example. Very simple initial commit. Takes in voltage from ADC and reports it to the user via terminal as % of total voltage. ~10% = indoors
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedAustin | 0:26a3a6edbb11 | 1 | #include "mbed.h" |
mbedAustin | 0:26a3a6edbb11 | 2 | |
mbedAustin | 0:26a3a6edbb11 | 3 | AnalogIn sensorUV(A0); |
mbedAustin | 0:26a3a6edbb11 | 4 | |
mbedAustin | 0:26a3a6edbb11 | 5 | int main() { |
mbedAustin | 0:26a3a6edbb11 | 6 | float value; |
mbedAustin | 0:26a3a6edbb11 | 7 | while (true) { |
mbedAustin | 0:26a3a6edbb11 | 8 | value = sensorUV; |
mbedAustin | 0:26a3a6edbb11 | 9 | printf("\rUV Value = %3.2f%%",value*100); |
mbedAustin | 0:26a3a6edbb11 | 10 | wait(.1); |
mbedAustin | 0:26a3a6edbb11 | 11 | } |
mbedAustin | 0:26a3a6edbb11 | 12 | } |