tAdd first untested attempt - lego_film_processor - software for rotary photographic film processor with Lego Mindstorms RCX (HTM) git clone git://src.adamsgaard.dk/lego_film_processor (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit f6e861e087f5d6bdbf567f7a54bf3e322341306b (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Sun, 7 Jul 2019 19:55:21 +0200 Add first untested attempt Diffstat: A Makefile | 12 ++++++++++++ A lego_jobo.nqc | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 0 deletions(-) --- (DIR) diff --git a/Makefile b/Makefile t@@ -0,0 +1,12 @@ +OUT = lego_jobo.rcx +NQC = nqc + +default: $(OUT) + +%.rcx: %.nqc + $(NQC) $< + +clean: + $(RM) *.rcx + +.PHONY: clean (DIR) diff --git a/lego_jobo.nqc b/lego_jobo.nqc t@@ -0,0 +1,26 @@ +#define t_turn 500 /* turn each way for 5 s */ + +task main() +{ + int i, t_current, t_end; + + t_current = 0; + t_end = 60*10 + 30; /* total development time */ + + Off(OUT_A+OUT_B+OUT_C); + SetPower(OUT_A, OUT_FULL); /* second arg an int between 0 and 7 */ + + i = 0; + while (t_current < t_end) { + + if (++i%2 == 0) + OnFwd(OUT_A); + else + OnRev(OUT_A); + + Wait(t_turn); + + t_current += t_turn; + } + Off(OUT_A); +}