sevensegnotletters

danya/stringtonumber/sevensegnotletters

No description
sevensegnotletters
@/sevensegnotletters
INnumber
sevensegnotletters
OUT1
OUT2
OUT3
OUT4
OUT5
OUT6
OUT7
IN
OUT7boolean
OUT6boolean
OUT5boolean
OUT4boolean
OUT3boolean
OUT2boolean
OUT1boolean
To use the node in your project you should have the danya/stringtonumber 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 {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    //auto inValue = getValue<input_IN>(ctx);
    //emitValue<output_OUT>(ctx, inValue);
int num_array[12][7] = {  { 1,1,1,1,1,1,0 },    // 0
                          { 0,1,1,0,0,0,0 },    // 1
                          { 1,1,0,1,1,0,1 },    // 2
                          { 1,1,1,1,0,0,1 },    // 3
                          { 0,1,1,0,0,1,1 },    // 4
                          { 1,0,1,1,0,1,1 },    // 5
                          { 1,0,1,1,1,1,1 },    // 6
                          { 1,1,1,0,0,0,0 },    // 7
                          { 1,1,1,1,1,1,1 },    // 8
                          { 1,1,1,1,0,1,1 },     // 9
                          { 0,0,0,0,0,0,0 },//
                          { 0,0,0,0,0,0,1 },//-
                        };   
    
    int a = getValue<input_IN>(ctx);
    
    
    
    if ((a<0||a>9)&&a!=-3){
    a =  10;
}
    if (a == -3){
    a = 11;
}
      
    
emitValue<output_OUT1>(ctx, !num_array[a][0]);
emitValue<output_OUT2>(ctx, !num_array[a][1]);
emitValue<output_OUT3>(ctx, !num_array[a][2]);
emitValue<output_OUT4>(ctx, !num_array[a][3]);
emitValue<output_OUT5>(ctx, !num_array[a][4]);
emitValue<output_OUT6>(ctx, !num_array[a][5]);
emitValue<output_OUT7>(ctx, !num_array[a][6]);
   

}