tlego_jobo.nqc - 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
---
tlego_jobo.nqc (724B)
---
1 #define T_TURN 600 /* turn each way for 6 s */
2
3 #define DEVELOP_MINS 25 /* number of minutes to develop for */
4 #define DEVELOP_SECS 30 /* number of seconds to develop for */
5 #define OUTPUT OUT_C
6
7 task
8 main()
9 {
10 int t_current, t_end;
11
12 Off(OUT_A + OUT_B + OUT_C);
13 SetSleepTime(60);
14 SetPower(OUTPUT, OUT_FULL); /* second arg an int between 0 and 7 */
15
16 On(OUTPUT);
17 t_current = 0;
18 t_end = 60*DEVELOP_MINS + DEVELOP_SECS;
19
20 while (t_current < t_end) {
21
22 SetPower(OUTPUT, OUT_FULL);
23 Wait(T_TURN - 100);
24
25 SetPower(OUTPUT, 1);
26 Wait(50);
27
28 Toggle(OUTPUT);
29 Wait(50);
30
31 t_current += T_TURN/100;
32 }
33 Off(OUT_A + OUT_B + OUT_C);
34 repeat (4) {
35 PlaySound(SOUND_UP);
36 }
37 SetSleepTime(5);
38 }