samele1222/ship-data
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); uint8_t i; uint32_t t1,tim; uint32_t timer = 100000; ::pinMode(Clock, OUTPUT); ::pinMode(Data, OUTPUT); ::digitalWrite(Clock, 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; } emitValue<output_OUT>(ctx, true); }
© 2017–2024XOD Inc
Contact us: hello@xod.io