Re: Art Controller Programming

#21011
Windell Oskay
Keymaster

Please see our wiki page on programming, for the “getting started” guide:  http://wiki.evilmadscientist.com/Art_Controller_Firmware

Look for this part of the code, where the trigger is issued:

                    if (PINB & 1// Make sure that cancel pin is HIGH (not active):

                    {

                        resetTimer();

                        StopTime = calculateStopTime();

                        TurnCoilOn();

                        Triggered = 1;

                        CoilOn = 1

                    }  

What you will want to do is to add the three-second delay at this point, maybe like so:

                    if (PINB & 1)  // Make sure that cancel pin is HIGH (not active):

                    {

                        resetTimer();

StopTime = 3;

while ( seconds() < StopTime)

{}

                        resetTimer();

                        StopTime = calculateStopTime();

                        TurnCoilOn();

                        Triggered = 1;

                        CoilOn = 1

                    } 

(Keep in mind that this is untested code, but it might point you in the right direction.)