November 24, 2024, 02:02:07 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Communicating With AP-8

Started by spann893, September 10, 2012, 05:38:51 PM

Previous topic - Next topic

spann893

Having a problem with The Prop 1 communicating to the AP8 can play segment 0 from the play button on the board, but not from the prop 1 serial connection.

' =========================================================================
'
'   File...... drac.BS1
'   Purpose... screamworld
'   Author.... Allen Spann
'   E-mail.... Spann893@sbcglobal.net
'   Started...
'   Updated... 16 AUG 2006
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  AP8     = 7                             ' serial I/O for AP-8
SYMBOL  Trigger = PIN6                          ' trigger input button
SYMBOL  Valves  = PINS                          ' uses P0..P4 only


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

SYMBOL  Yes     = 1                             ' for active high input
SYMBOL  No      = 0


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

SYMBOL  temp    = B0                            ' value for pins
SYMBOL  fini    = BIT7                          ' sequenced finished
SYMBOL  pntr    = B2                            ' table pointer
SYMBOL  delay   = B3                            ' delay in 1/10 seconds
SYMBOL  dBounce = B4


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

Move_Table:
  EEPROM (%00000101,   25)   'light on, drac up
  EEPROM (%00000111,   10)   'drac out
  EEPROM (%00000101,   10)   'drac back
  EEPROM (%00000111,   10)   'drac out
  EEPROM (%00000101,   10)   'drac back
  EEPROM (%00000111,   10)   'drac out
  EEPROM (%00000101,   07)   'drac back
  EEPROM (%00000111,   07)   'drac out
  EEPROM (%00000000,   10)   'drac down
  EEPROM (%10000000,   10)                       ' 20 sec re-trigger delay


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

Setup:
  DIRS = %00011111                              ' P0..P4 are outputs


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

Main:
  dBounce = dBounce + 1
  dBounce = dBounce * Trigger
  IF dBounce < 9 THEN Main                      ' wait for trigger
  dBounce = 0
  pntr = 0                                      ' reset to start of table

Start_SFX:                                      ' activate sound
  SEROUT AP8, OT2400, ("!AP8", %00, "P", 0)

Engine:
  READ pntr, temp                               ' read valves from table
  pntr = pntr + 1                               ' point to delay
  READ pntr, delay                              ' read delay from table
  pntr = pntr + 1                               ' point to next record

  Valves = temp                                 ' update the valves outputs
  GOSUB Timer                                   ' hold for timing

  IF fini = Yes THEN Main                       ' sequence done?
    GOTO Engine                                 ' no, continue


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

Timer:
  IF delay = 0 THEN Timer_Exit                  ' delay finished?
    PAUSE 100                                   ' no, hold 1/10 second
    delay = delay - 1                           ' update delay counter
    GOTO Timer                                  ' keep going

Timer_Exit:
  RETURN                                        ' return to caller

IMTim

I would say check your address jumpers on the AP-8.  And make sure you have the serial cable connected correctly.

Good luck,

Tim
"We had become the thing we hate. We are better dead."

Sparlimb Keelsetter "The Illearth War"

spann893

Ran the AP8 comunication debug file. had comunication, and dips were set properly for serial selection of the sound recorded on segment 0 but prop code still could not call up the sound. Wiped the sound off of the ap8 and re recorded. Recorded the sound to segment 7 instead of segment 0 as the sound was 11 seconds long. not too long for segment 7. Changed the serial call out to segment 7 in the code and all is working now.

IMTim

Excellent, good job.  I use Cool Edit for my sound files and every now and then I don't save them in the correct WAV format.  Since they are so cheap I keep an extra SD card with a sound file I know works to help troubleshoot my AP-16+.
"We had become the thing we hate. We are better dead."

Sparlimb Keelsetter "The Illearth War"