my-datetime

sergtzar67/program-clock-v01/my-datetime

No description
my-datetime
@/my-datetime
HOURnumber
MINnumber
SECnumber
my-datetime
OUT
HOUR
MIN
SEC
OUTnumber
To use the node in your project you should have the sergtzar67/program-clock-v01 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

struct State {
};

using Type = uint32_t;

{{ GENERATED_CODE }}

void evaluate(Context ctx) {

    uint32_t hour = getValue<input_HOUR>(ctx);
    uint32_t min = getValue<input_MIN>(ctx);
    uint32_t sec = getValue<input_SEC>(ctx);
    uint32_t seconds=0;

    seconds += hour * 3600;
    seconds += min * 60;
    seconds += sec;
    if (seconds>86400){
        hour=0;
        min=0;
    }
    emitValue<output_OUT>(ctx, seconds);
}