November 26, 2024, 12:56:54 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.


Trouble Getting Segment Zero (0) to Play on AP-8

Started by Spooky Dad, September 07, 2008, 07:11:29 PM

Previous topic - Next topic

Spooky Dad

All other of the default sounds on the AP-8 play, except for the one sound I loaded in Segment 0.  When I hit the play button on the AP-8, the sound I recorded plays.  Any ideas on what I am doing wrong?

' =========================================================================
'
'   File......
'   Purpose... Basic test of PIR, AP-8, and Prop-1
'   Author....
'   E-mail....
'   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


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

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Baud            = OT2400


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00111111                              ' make P0-P5 outputs


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

Main:
  timer = 0                                     ' reset timer
  DEBUG "Waiting for PIR...", CR

Check_Trigger:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * PIR                       ' update timer
  IF timer < 100 THEN Check_Trigger             ' wait for 0.1 sec input

  DEBUG "Triggered!", CR, CR

  SEROUT Sio, Baud, ("!AP8", %00, "P", 0)       '1 rooster, 2 cow, 3 chimp, 4 horse, 5 dog, 6 cat, 7 elephant,

  DEBUG "Sound command sent", CR, CR

  PAUSE 1000
  DEBUG "Thousand One", CR, CR

  PAUSE 1000
  DEBUG "Thousand Two", CR, CR

  PAUSE 1000
  DEBUG "Thousand Three", CR, CR

  PAUSE 1000
  DEBUG "Thousand Four", CR, CR

  PAUSE 1000
  DEBUG "Thousand Five", CR, CR


  GOTO Main


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


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


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


' -----[ User Data ]-------------------------------------------------------

JonnyMac

It runs as intended on my Prop-1/AP-8 setup.  Do you have the WRB wire plugged in correctly?  I had it backward at first.
Jon McPhalen
EFX-TEK Hollywood Office

Spooky Dad

Yes.  To be clear, its only segment 0 that attempts to play (the speaker's humm a bit and then go quiet) and fails.  When I change the code to refer to segments 1 through 7, all of those sounds still play. 

JonnyMac

Sounds like segment 0 got erased -- you might try re-recording it.
Jon McPhalen
EFX-TEK Hollywood Office

Spooky Dad

I'll rerecord.  When I hit the play button manually, I do hear the sound I recorded. 

JonnyMac

I'm baffled... must be aliens.  Or space monkeys!   :D
Jon McPhalen
EFX-TEK Hollywood Office