0.1.5 AnalogUVSensor

This commit is contained in:
Rob Tillaart 2023-10-17 15:01:26 +02:00
parent 2a1eb2fa4e
commit 61587df854
6 changed files with 31 additions and 13 deletions

View File

@ -1,7 +1,7 @@
// //
// FILE: AnalogUVSensor.h // FILE: AnalogUVSensor.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.4 // VERSION: 0.1.5
// DATE: 2021-09-25 // DATE: 2021-09-25
// PURPOSE: Arduino library for an analogue UV sensor. // PURPOSE: Arduino library for an analogue UV sensor.
// URL: https://github.com/RobTillaart/AnalogUVSensor // URL: https://github.com/RobTillaart/AnalogUVSensor
@ -13,7 +13,7 @@
AnalogUVSensor::AnalogUVSensor() AnalogUVSensor::AnalogUVSensor()
{ {
// defaults from UNO. // defaults from UNO.
_analogPin = 14; // A0 _analogPin = 14; // A0 for UNO
_volts = 5; _volts = 5;
_maxADC = 1023; _maxADC = 1023;
_powerPin = -1; _powerPin = -1;

View File

@ -2,7 +2,7 @@
// //
// FILE: AnalogUVSensor.h // FILE: AnalogUVSensor.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.4 // VERSION: 0.1.5
// DATE: 2021-09-25 // DATE: 2021-09-25
// PURPOSE: Arduino library for an analogue UV sensor. // PURPOSE: Arduino library for an analogue UV sensor.
// URL: https://github.com/RobTillaart/AnalogUVSensor // URL: https://github.com/RobTillaart/AnalogUVSensor
@ -10,7 +10,7 @@
#include "Arduino.h" #include "Arduino.h"
#define ANALOG_UVSENSOR_LIB_VERSION (F("0.1.4")) #define ANALOG_UVSENSOR_LIB_VERSION (F("0.1.5"))
class AnalogUVSensor class AnalogUVSensor

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.5] - 2023-10-17
- update readme.md (badges)
## [0.1.4] - 2023-01-22 ## [0.1.4] - 2023-01-22
- update GitHub actions - update GitHub actions
- update license 2023 - update license 2023
@ -13,7 +17,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- update examples - update examples
- minor edits - minor edits
## [0.1.3] - 2022-10-28 ## [0.1.3] - 2022-10-28
- Add RP2040 support to build-CI. - Add RP2040 support to build-CI.
- Add CHANGELOG.md - Add CHANGELOG.md

View File

@ -1,9 +1,12 @@
[![Arduino CI](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/arduino_test_runner.yml/badge.svg)](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/arduino_test_runner.yml) [![Arduino CI](https://github.com/RobTillaart/AnalogUVSensor/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/arduino-lint.yml) [![Arduino-lint](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/jsoncheck.yml) [![JSON check](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/AnalogUVSensor/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/AnalogUVSensor.svg)](https://github.com/RobTillaart/AnalogUVSensor/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/AnalogUVSensor/blob/master/LICENSE) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/AnalogUVSensor/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/AnalogUVSensor.svg?maxAge=3600)](https://github.com/RobTillaart/AnalogUVSensor/releases) [![GitHub release](https://img.shields.io/github/release/RobTillaart/AnalogUVSensor.svg?maxAge=3600)](https://github.com/RobTillaart/AnalogUVSensor/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/AnalogUVSensor.svg)](https://registry.platformio.org/libraries/robtillaart/AnalogUVSensor)
# AnalogUVSensor # AnalogUVSensor
@ -16,7 +19,7 @@ Arduino library for an analogue UV sensor.
![Foo](https://www.tinytronics.nl/shop/image/cache/catalog/products/product-003601/uv-light-sensor-module-200-370nm-80x80w.jpg) ![Foo](https://www.tinytronics.nl/shop/image/cache/catalog/products/product-003601/uv-light-sensor-module-200-370nm-80x80w.jpg)
Image courtesy Tinytronics Image courtesy Tinytronics
This small (type-less) UV-sensor is powered by 3.3 .. 5 V so it can be used by almost any microprocessor. This small (type-less) UV-sensor is powered by 3.3 .. 5.0 V so it can be used by almost any microprocessor.
The sensor has an analogue output that is roughly linear with the UV-index (sunlight assumed, see notes). The sensor has an analogue output that is roughly linear with the UV-index (sunlight assumed, see notes).
@ -76,10 +79,15 @@ More about UV see - https://en.wikipedia.org/wiki/Ultraviolet
#### Related #### Related
- https://github.com/RobTillaart/ML8511 - https://github.com/RobTillaart/ML8511
- https://github.com/RobTillaart/map2colour
## Interface ## Interface
```cpp
#include "AnalogUVSensor.h"
```
- **AnalogUVSensor()** Constructor. - **AnalogUVSensor()** Constructor.
- **void begin(uint8_t analogPin, float volts = 5.0, uint16_t maxADC = 1023)** - **void begin(uint8_t analogPin, float volts = 5.0, uint16_t maxADC = 1023)**
set the parameters of the sensor, analogPin, volts and maxADC to specify the internal ADC. set the parameters of the sensor, analogPin, volts and maxADC to specify the internal ADC.
@ -130,8 +138,6 @@ e.g. when the analogue sensor is switched through a MOSFET.
- investigate response time to stabilize e.g. does it react fast on clouds. - investigate response time to stabilize e.g. does it react fast on clouds.
- investigate time needed to first (stable) measurement. - investigate time needed to first (stable) measurement.
- add code for external ADC (see ACS712) - add code for external ADC (see ACS712)
- add mV to RGB colour?
#### Wont #### Wont
@ -141,7 +147,16 @@ e.g. when the analogue sensor is switched through a MOSFET.
- created a https://github.com/RobTillaart/map2colour lib for this feature - created a https://github.com/RobTillaart/map2colour lib for this feature
to keep footprint in this library small. to keep footprint in this library small.
## Sponsor ## Sponsor
The development of this library is sponsored by [TinyTronics, Netherlands](https://www.tinytronics.nl/shop/nl). The development of this library is sponsored by [TinyTronics, Netherlands](https://www.tinytronics.nl/shop/nl).
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,

View File

@ -15,9 +15,9 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/AnalogUVSensor.git" "url": "https://github.com/RobTillaart/AnalogUVSensor.git"
}, },
"version": "0.1.4", "version": "0.1.5",
"license": "MIT", "license": "MIT",
"frameworks": "arduino", "frameworks": "*",
"platforms": "*", "platforms": "*",
"headers": "AnalogUVSensor.h" "headers": "AnalogUVSensor.h"
} }

View File

@ -1,5 +1,5 @@
name=AnalogUVSensor name=AnalogUVSensor
version=0.1.4 version=0.1.5
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=AnalogUVSensor library for Arduino. sentence=AnalogUVSensor library for Arduino.