GY-63_MS5611/libraries/AnalogUVSensor/examples/uvi_demo/uvi_demo.ino

36 lines
572 B
Arduino
Raw Normal View History

2021-09-29 11:06:47 -04:00
//
// FILE: uvi_demo.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo UV sensor
// DATE: 2021-09-25
2023-01-22 13:19:42 -05:00
// URL: https://github.com/RobTillaart/AnalogUVSensor
2021-09-29 11:06:47 -04:00
#include "AnalogUVSensor.h"
AnalogUVSensor AUV;
2023-01-22 13:19:42 -05:00
2021-09-29 11:06:47 -04:00
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()
{
2022-10-28 15:40:39 -04:00
float uvi = AUV.read(5); // average 5 readings
2021-09-29 11:06:47 -04:00
Serial.print("UVI: ");
Serial.println(uvi, 1);
delay(1000);
}
2023-01-22 13:19:42 -05:00
// -- END OF FILE --