sevenseg

danya/stringtonumber/sevenseg

No description
sevenseg
@/sevenseg
INnumber
sevenseg
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[38][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
                          { 1,1,1,0,1,1,1 },//a
                          { 0,0,1,1,1,1,1 },//b
                          { 1,0,0,1,1,1,0 },//c
                          { 0,1,1,1,1,0,1 },//d
                          { 1,0,0,1,1,1,1 },//e
                          { 1,0,0,0,1,1,1 },//f
                          { 1,0,1,1,1,1,0 },//g
                          { 0,0,1,0,1,1,1 },//h
                          { 0,1,1,0,0,0,0 },//i
                          { 0,1,1,1,0,0,0 },//j
                          { 1,0,1,0,1,1,1 },//k
                          { 0,0,0,1,1,1,0 },//l
                          { 1,0,1,0,1,0,0 },//m
                          { 0,0,1,0,1,0,1 },//n
                          { 1,1,1,1,1,1,0 },//o
                          { 1,1,0,0,1,1,1 },//p
                          { 1,1,1,0,0,1,1 },//q
                          { 0,0,0,0,1,0,1 },//r
                          { 1,0,1,1,0,1,1 },//s
                          { 0,0,0,1,1,1,1 },//t
                          { 0,1,1,1,1,1,0 },//u
                          { 0,0,1,1,1,0,0 },//v
                          { 0,1,0,1,0,1,0 },//w
                          { 0,1,1,0,1,1,1 },//x
                          { 0,1,1,1,0,1,1 },//y
                          { 1,1,0,1,1,0,1 },//z
                          { 0,0,0,0,0,0,0 },//
                          { 0,0,0,0,0,0,1 },//-
                        };   
    
    int a = getValue<input_IN>(ctx);
    
    
    
    if ((a<0||a>35)&&a!=-3){
    a =  36;
}
    if (a == -3){
    a = 37;
}
      
    
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]);
   

}