0.1.3 TSL260R

This commit is contained in:
rob tillaart 2023-02-18 16:02:16 +01:00
parent 9e2ad31141
commit 1a4b9fe2e7
11 changed files with 53 additions and 20 deletions

View File

@ -6,7 +6,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update

View File

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

View File

@ -10,7 +10,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
with:

View File

@ -6,7 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.3] - 2023-02-18
- refactor constructor
- update readme.md
- update GitHub actions
- update license 2023
- minor edits
## [0.1.2] - 2022-11-27
- add getter / setter for \_aa and \_bb
- add unit tests for get/set above
- update comments
@ -14,8 +24,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- update examples
- fix space in .cpp name
## [0.1.1] - 2022-11-27
- update documentation
- add analogRead Constructor
- add irradiance() for internal analogRead()
@ -24,8 +34,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- add extra example.
- add keywords.txt
## [0.1.0] - 2022-11-25
- initial version - written on datasheet only
Need to buy hardware for testing.

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022-2022 Rob Tillaart
Copyright (c) 2022-2023 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -30,11 +30,19 @@ When using e.g. an external 16 bit ADS1115, one definitely has far more steps.
**Warning** this library is experimental so you should use it with care.
It is written on the datasheet, and I have no hardware yet to test it.
It is written on the datasheet as I have no hardware yet to test it.
Of course I am very interested in your experiences and feedback to improve
the library.
#### Related
- https://github.com/RobTillaart/TSL235R pulse based irradiance variant.
- https://github.com/RobTillaart/TSL260R analog IR irradiance variant.
- https://github.com/RobTillaart/AnalogUVSensor
- https://github.com/RobTillaart/ML8511 UV sensor
## Hardware Connection
#### Power supply
@ -61,6 +69,10 @@ Always check datasheet
## Interface
```CPP
#include "TSL260R.h"
```
#### Internal ADC
- **TSL260R(uint8_t pin, uint16_t maxADC, float voltage)** Constructor when using an
@ -124,13 +136,14 @@ See examples.
## Future
#### must
#### Must
- improve documentation
- buy hardware (where)
- test test test test
#### Should
#### should
- extend unit tests
- write examples
- fix the dependency of **irradiance()**
@ -138,10 +151,14 @@ See examples.
- optimize code
-
#### could
#### Could
- test with different IR LEDS (e.g. remote)
- Normalized Output Voltage vs Angular Displacement correction
- figure 11
- temperature correction
-
#### Wont

View File

@ -1,9 +1,10 @@
//
// FILE: TSL260R.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.1.2
// VERSION: 0.1.3
// DATE: 2022-11-25
// PURPOSE: library for the TSL260R IR to voltage convertor
// URL: https://github.com/RobTillaart/TSL260R
#include "TSL260R.h"
@ -17,13 +18,16 @@ TSL260R::TSL260R(uint8_t pin, uint16_t maxADC, float voltage)
// irradiance parameters
_aa = 10.0067;
_bb = -0.02013423;
// waveLength parameters
_waveLength = 940;
_waveLengthFactor = 1.0;
}
TSL260R::TSL260R()
{
TSL260R(0, 1, 0); // prevent divide by zero
// datasheet page 9
// datasheet page 9 figure 12
// irradiance parameters
_aa = 10.0067;
_bb = -0.02013423;

View File

@ -2,12 +2,13 @@
//
// FILE: TSL260R.h
// AUTHOR: Rob Tillaart
// VERSION: 0.1.2
// VERSION: 0.1.3
// DATE: 2022-11-25
// PURPOSE: library for the TSL260R IR to voltage convertor
// URL: https://github.com/RobTillaart/TSL260R
#define TSL260R_LIB_VERSION (F("0.1.2"))
#define TSL260R_LIB_VERSION (F("0.1.3"))
#include "Arduino.h"
@ -51,12 +52,13 @@ protected:
float _waveLengthFactor = 1;
// _aa and _bb are defined in constructor;
// need getter / setter to adjust values runtime
float _aa;
float _bb;
float _aa = 10.0067;
float _bb = -0.02013423;
float multiMap(float value, float * _in, float * _out, uint8_t size);
};
///////////////////////////////////////////////////////
//
// DERIVED CLASSES

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/TSL260R.git"
},
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"frameworks": "*",
"platforms": "*",

View File

@ -1,8 +1,8 @@
name=TSL260R
version=0.1.2
version=0.1.3
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for the TSL260R, TSL261R and TSL262R infrared to voltage convertor.
sentence=Arduino library for the TSL260R, TSL261R and TSL262R infrared to voltage convertor.
paragraph=Includes wavelength compensation. 940 nanoMeter is default.
category=Sensors
url=https://github.com/RobTillaart/TSL260R

View File

@ -144,4 +144,4 @@ unittest(test_get_setWaveLength)
unittest_main()
// --------
// -- END OF FILE --