tcs34725-raw-data

antoniorrg/tcs34725/tcs34725-raw-data

No description
tcs34725-raw-data
@/tcs34725-raw-data
IN@/tcs34725-device
To link with tcs34725-device
UPDpulse
Updates,. Triggers new sensor reading
tcs34725-raw-data
IN
colorTemp
lux
R
G
B
C
DONE
UPD
DONEpulse
Cnumber
Displays the intensity value of clear light
Bnumber
Displays the intensity of light in the blue spectrum (465 nm)
Gnumber
Displays the intensity of light in the green spectrum (525 nm)
Rnumber
Displays the intensity of light in the red spectrum (615 nm)
luxnumber
Displays the value of illuminance (in lx units)
colorTempnumber
Displays the value of Color temperature (in K)
To use the node in your project you should have the antoniorrg/tcs34725 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#include <Wire.h>
#include "Adafruit_TCS34725.h"

node {
    // Internal state variables defined at this level persists across evaluations
    Number foo;
    uint8_t bar = 5;

    void evaluate(Context ctx) {
        bar += 42;

        if (isSettingUp()) {
            // This run once
            foo = (Number)(bar + 1);
        }

auto tcs = getValue<input_IN>(ctx);
  uint16_t r, g, b, c, colorTemp, lux;

  tcs->getRawData(&r, &g, &b, &c);
  colorTemp = tcs->calculateColorTemperature_dn40(r, g, b, c);
  lux = tcs->calculateLux(r, g, b);

  emitValue<output_colorTemp>(ctx, colorTemp);
  emitValue<output_lux>(ctx, lux);
  emitValue<output_R>(ctx, r);
  emitValue<output_G>(ctx, g);
  emitValue<output_B>(ctx, b);
  emitValue<output_C>(ctx, c);
        
    }
}