' PROP CONTROLLER V3.0 ' Basic program skeleton ' Alle Angaben ohne Gewähr. ' Verwendung auf eigene Gefahr, soweit gesetzlich zulässig. ' Eine Haftung gemäß §823 BGB besteht grundsätzlich nur bei Vorsatz und grober Fahrlässigkeit. ' (c) 2004-2008 Sascha Kimmel. Alle Rechte vorbehalten. ' Lizenz: CreativeCommons Attribution-NonCommercial-ShareAlike-3.0 http://creativecommons.org/licenses/by-nc-sa/3.0/de/ ' Homepage: http://www.sascha-kimmel.com/propcontroller ' Date: 15.09.2004, 21.08.2005, 28.10.2005, 26.10.2007 ' ------ CORE CONFIG BLOCK ------------------------------------------------------------------- ' ------ You should not change anything here unless you really know what you are doing ' ------ as this may damage the PropController ' -------------------------------------------------------------------------------------------- ' Define our trigger input DEFINE TRIGGER port[7] ' When the program is running (i.e. the TRIGGER input has ' been activated) and the program is running its pre-defined ' program this must be set to 1, else to 0 DEFINE RUNNING port[5] ' This must be checked on every TRIGGER event. If this input ' is set to 1 the program must behave as if it has not been triggered DEFINE PREVENT port[6] ' Must be set to 1 at the start of the program and set to 0 when the ' sound should be activated, triggers PLAY on the ISD1420 voice recorder DEFINE SOUND port[8] ' The ports have to be mapped because of the board layout ' All these ports have to be set to output at the beginning of the program DEFINE OUT1 port[16] DEFINE OUT2 port[15] DEFINE OUT3 port[14] DEFINE OUT4 port[13] DEFINE OUT5 port[12] DEFINE OUT6 port[11] DEFINE OUT7 port[10] DEFINE OUT8 port[9] DEFINE OUT9 port[1] DEFINE OUT10 port[2] DEFINE OUT11 port[3] DEFINE OUT12 port[4] ' ----- INPUT/OUTPUT SETTINGS ' DEACT sets ports to input mode DEACT TRIGGER DEACT PREVENT RUNNING=OFF SOUND=ON OUT1=OFF OUT2=OFF OUT3=OFF OUT4=OFF OUT5=OFF OUT6=OFF OUT7=OFF OUT8=OFF OUT9=OFF OUT10=OFF OUT11=OFF OUT12=OFF ' -------------------------------------------------------------------------------- ' ----- END OF CORE CONFIG BLOCK ------------------------------------------------- ' -------------------------------------------------------------------------------- ' -------------------------------------------------------------------------------- ' ------------------------ CUSTOM CODE ------------------------------------------- ' -------------------------------------------------------------------------------- ' You may change the code here but it is not recommended, instead you should simply ' put your own code into the MAIN PART section below ' Delay the trigger possibility when the program ends ' 500 = 10 seconds DEFINE repeatdelay 500 ' Here starts our main program #start ' Wait until someone triggers our controller WAIT TRIGGER IF PREVENT THEN GOTO START ' Indicate that the program is running RUNNING=ON '--------------------------------------------------------------------------------------- '--------------------------------------------------------------------------------------- ' MAIN PART ---------------------------------------------------------------------------- ' Wait a bit... 'PAUSE 10 ' Turn on the light TOG OUT1 ' Turn on the voice module GOSUB playsound ' Wait for the specific time until the played sound is at the correct position PAUSE 300 ' Turn on the 24V output TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 PAUSE 35 TOG OUT2 ' Wait a bit more as the sound is still playing PAUSE 500 ' TURN OFF THE LIGHT TOG OUT1 'END OF MAIN PART ---------------------------------------------------------------------- '--------------------------------------------------------------------------------------- ' You may change the code below but is is not recommended! ' Safety net: set all outputs to OFF in case we forgot one OUT1=OFF OUT2=OFF OUT3=OFF OUT4=OFF OUT5=OFF OUT6=OFF OUT7=OFF OUT8=OFF OUT9=OFF OUT10=OFF OUT11=OFF OUT12=OFF ' Wait some seconds so that the action will not be started again immediately PAUSE repeatdelay ' Turn of running indicator RUNNING=OFF ' Go back to the start - this is purely a neverending story ;) GOTO start ' Activate the voice module by sending a short LOW #playsound SOUND=OFF PAUSE 20 SOUND=ON RETURN