mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
36 lines
572 B
C++
36 lines
572 B
C++
//
|
|
// FILE: uvi_demo.ino
|
|
// AUTHOR: Rob Tillaart
|
|
// PURPOSE: demo UV sensor
|
|
// DATE: 2021-09-25
|
|
// URL: https://github.com/RobTillaart/AnalogUVSensor
|
|
|
|
|
|
#include "AnalogUVSensor.h"
|
|
|
|
AnalogUVSensor AUV;
|
|
|
|
|
|
void setup()
|
|
{
|
|
Serial.begin(115200);
|
|
Serial.println(__FILE__);
|
|
|
|
Serial.print("ANALOG_UVSENSOR_LIB_VERSION: ");
|
|
Serial.println(ANALOG_UVSENSOR_LIB_VERSION);
|
|
|
|
AUV.begin(A0, 5.0, 1023);
|
|
}
|
|
|
|
|
|
void loop()
|
|
{
|
|
float uvi = AUV.read(5); // average 5 readings
|
|
Serial.print("UVI: ");
|
|
Serial.println(uvi, 1);
|
|
delay(1000);
|
|
}
|
|
|
|
|
|
// -- END OF FILE --
|