struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if(!getValue<input_EN>(ctx))
return;
auto Value = getValue<input_IN>(ctx);
auto Clock = getValue<input_CLOCK>(ctx);
auto Data = getValue<input_DATA>(ctx);
auto Trig = getValue<input_TRIG>(ctx);
uint8_t i;
uint32_t t1,tim;
uint32_t timer = 1000000;
::pinMode(Clock, OUTPUT);
::pinMode(Data, OUTPUT);
::pinMode(Trig, OUTPUT);
::digitalWrite(Clock, 0);
::digitalWrite(Trig, 0);
for(tim=timer;tim>0;tim--)t1 = tim;
for(i=0x80;i>0;i=i/2){
::digitalWrite(Data, !(Value&i)? 0 : 1);
::digitalWrite(Clock, 1);
for(tim=timer;tim>0;tim--)t1 = tim;
::digitalWrite(Clock, 0);
for(tim=timer;tim>0;tim--)t1 = tim;
}
::digitalWrite(Trig, 1);
for(tim=timer;tim>0;tim--)t1 = tim;
::digitalWrite(Trig, 0);
for(tim=timer;tim>0;tim--)t1 = tim;
emitValue<output_OUT>(ctx, true);
}