November 24, 2024, 02:49:58 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


sound trouble

Started by cooperfan, September 23, 2007, 06:20:50 PM

Previous topic - Next topic

cooperfan

 Hey Jon you wrote this program for me a while back. I can,t seem to get the sound to work. I have the extention cable plugged into #7. The jumper on the prop 1 @ #7 out.  Jumpers on the AP-8 out. I can push the button on the AP-8 and it works but not when the Prop 1 is triggered. Any idea what i'm doing wrong?

Dean

=========================================================================
'
'   File...... Pig_Box.BS1
'   Purpose...
'   Author.... Jon Williams
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  PIR             = PIN6                  ' SETUP = DN
SYMBOL  Mister          = PIN3
SYMBOL  Strobe          = PIN2
SYMBOL  Alarm           = PIN1
SYMBOL  Beacon          = PIN0


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0


' -----[ Variables ]-------------------------------------------------------

SYMBOL  pirTimer        = B2


' -----[ Initialization ]--------------------------------------------------

Reset:
  PINS = %00000000                              ' all off
  DIRS = %00001111                              ' set outputs

  SEROUT Sio, OT2400, ("!!!!!!!AP8", %00, "X")  ' kill sound
  PAUSE 10000
  pirTimer = 0


' -----[ Program Code ]----------------------------------------------------

Main:
  PAUSE 10
  pirTimer = pirTimer + 10 * PIR                ' update pir timer
  IF pirTimer < 250 THEN Main                   ' wait for 1/4 sec signal

  Beacon = IsOn
  Alarm = IsOn
  PAUSE 2000
  Alarm = IsOff
  Strobe = IsOn
  SEROUT Sio, OT2400, ("!AP8", %00, "P", 0)     ' start sound 0
  PAUSE 1000
  Mister = IsOn
  PAUSE 10000

  GOTO Reset                                    ' stop everything


' -----[ Subroutines ]-----------------------------------------------------


' -------------------------------------------------------------------------


' -----[ EEPROM Data ]-----------------------------------------------------

JonnyMac

Did you replace the ULN2803 with a ULN2003?  See this thread: http://www.efx-tek.com/php/smf/index.php?topic=130.0

Also, make sure that the B/R, A1, and A0 jumpers are removed from your AP-8; this sets it to 2400 baud (for Prop-1) and address %00 as used by that program.
Jon McPhalen
EFX-TEK Hollywood Office