tAdd better finish chime and capitalize constants - 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 bc96f1816b4fec6ffbfa90d262c16cbb63a8a365
 (DIR) parent 1df0b54458da33a4f47e5fa99341a9537cbe584f
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Sun,  7 Jul 2019 20:34:44 +0200
       
       Add better finish chime and capitalize constants
       
       Diffstat:
         M lego_jobo.nqc                       |      44 ++++++++++++++++++-------------
       
       1 file changed, 26 insertions(+), 18 deletions(-)
       ---
 (DIR) diff --git a/lego_jobo.nqc b/lego_jobo.nqc
       t@@ -1,30 +1,38 @@
       -#define t_turn 500              /* turn each way for 5 s */
       +#define T_TURN 500              /* turn each way for 5 s */
       +#define OUTPUT OUT_A
       +
       +#define DEVELOP_MINS 10         /* number of minutes to develop for */
       +#define DEVELOP_SECS 30         /* number of seconds to develop for */
        
        task main()
        {
       -        int i, t_current, t_end;
       -
       -        t_current = 0;
       -        t_end = 60*10 + 30;         /* total development time */
       +        int i, t_current;
       +        int t_end = 60*DEVELOP_MINS + DEVELOP_SECS;
       +        SetSleepTime(60);
        
       -        Off(OUT_A+OUT_B+OUT_C);
       -        SetPower(OUT_A, OUT_FULL);  /* second arg an int between 0 and 7 */
       +        Off(OUTPUT);
       +        SetPower(OUTPUT, OUT_FULL);    /* second arg an int between 0 and 7 */
        
       -        i = 0;
       +        t_current = 0;
                while (t_current < t_end) {
        
       -                if (++i%2 == 0)
       -                        OnFwd(OUT_A);
       -                else
       -                        OnRev(OUT_A);
       +                Wait(T_TURN);
       +                Toggle(OUTPUT);
        
       -                Wait(t_turn);
       -
       -                t_current += t_turn;
       +                t_current += T_TURN;
                }
       -        Off(OUT_A);
       +        Off(OUTPUT);
       +
                for (i=0; i<4; ++i) {
       -                PlayTone(440,100);
       -                PlayTone(220,100);
       +                PlayTone(147, 50);  /* d   */
       +                PlayTone(156, 50);  /* d#  */
       +                PlayTone(147, 50);  /* d   */
       +                PlayTone(294, 100); /* d+1 */
       +
       +                PlayTone(147, 50);  /* d   */
       +                PlayTone(156, 50);  /* d#  */
       +                PlayTone(147, 50);  /* d   */
       +                PlayTone(175, 100); /* f   */
                }
       +        SetSleepTime(5);
        }