Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Loom_AS7265X.h
1#pragma once
2
3#include <SparkFun_AS7265X.h>
4#include <Wire.h>
5
6#include "../I2CDevice.h"
7#include "Loom_Manager.h"
8
14class Loom_AS7265X : public I2CDevice{
15 protected:
16
17 void power_down() override {};
18
19
20 // Manager controlled functions
21 void measure() override;
22 void initialize() override;
23 void package() override;
24 void power_up() override;
25
26 public:
38 Manager& man,
39 bool useMux = false,
40 int addr = 0x49,
41 bool use_bulb = false,
42 uint8_t gain = 64,
43 uint8_t mode = AS7265X_MEASUREMENT_MODE_6CHAN_ONE_SHOT,
44 uint8_t integration_time = 50
45 );
46
47 /* Returns a pointer to the UV array, it is 6 elements*/
48 uint16_t* getUV() { return uv; };
49
50 /* Returns a pointer to the color array, it is 6 elements*/
51 uint16_t* getColor() { return color; };
52
53 /* Returns a pointer to the NIR array, it is 6 elements*/
54 uint16_t* getNIR() { return nir; };
55 private:
56 Manager* manInst; // Instance of the manager
57 AS7265X asInst; // Instance of the AS7265X
58
59 uint16_t uv[6]; // Measured UV bands values. Units: counts / (μW/cm^2)
60 uint16_t color[6]; // Measured color bands values. Units: counts / (μW/cm^2)
61 uint16_t nir[6]; // Measured near-infra-red bands values. Units: counts / (μW/cm^2)
62
63 bool use_bulb; // Whether or not to use the bulb
64
65 uint8_t gain; // Gain setting
66 uint8_t mode; // Sensor mode
67 uint8_t integration_time; // Integration time setting
68};
Definition: I2CDevice.h:6
Definition: Loom_AS7265X.h:14
Definition: Loom_Manager.h:18