tcs34725-device

antoniorrg/tcs34725/tcs34725-device

Device node connected to the tcs34725-raw-data
tcs34725-device
@/tcs34725-device
Device node connected to the tcs34725-raw-data
tcs34725-device
OUT
OUT@/tcs34725-device
To link with tcs34725
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

#pragma XOD require "https://github.com/adafruit/Adafruit_TCS34725"
#include <Wire.h>
#include "Adafruit_TCS34725.h"

node {

        meta {
        // Define our custom type as a pointer on the class instance.
        using Type = Adafruit_TCS34725*;
    }

    Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_700MS, TCS34725_GAIN_1X);
    
    // 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);
        }

tcs.begin();
emitValue<output_OUT>(ctx, &tcs);
        

        
    }
}