November 21, 2024, 03:09:15 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.


crate beast program

Started by ufo8mycow, October 09, 2007, 07:16:39 PM

Previous topic - Next topic

ufo8mycow

The only problem with that is that it needs to be working and ready to go by tuesday morning for our haunt at work. I am just going to be useing one sound that is triggered at the same time and for the same duration as the valves.

JonnyMac

October 19, 2007, 03:01:42 PM #16 Last Edit: October 21, 2007, 01:11:24 PM by JonnyMac
Easy-peezy, I'm super cheezy!   ;D

Now... your job is to read the AP-8 documentation so that you can reliably record your audio into slot zero (2, 1, and 0 switches on).  After that's done, open all the switches, remove the B/R, A1, and A0 jumpers, then connect to P7 with a 3-pin cable.  Make sure you pull the P7 SETUP jumper and change the ULN2803 for a ULN2003, or clip pin 1 of the ULN2803 as described in this thread: http://www.efx-tek.com/php/smf/index.php?topic=130.0

Corrected a typo on 21 OCT 2007


' =========================================================================
'
'   File...... Crate_Beast_UFO8MyCow_v2.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2007 EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 21 OCT 2007
'
'   {$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  Valve2          = PIN4                  ' OUT4/V+ to valve
SYMBOL  Valve1          = PIN3                  ' OUT3/V+ to valve
SYMBOL  Wiper           = PIN2                  ' OUT2/V+ to relay
SYMBOL  Speaker         = PIN1                  ' no longer used
SYMBOL  Fogger          = PIN0                  ' OUT0/V+ to relay


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

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

SYMBOL  Baud            = OT2400


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

SYMBOL  delay           = W3                    ' valve movement delay
SYMBOL  timer           = W4
SYMBOL  lottery         = W5                    ' random value
SYMBOL   lottoLo        = B10                   ' low byte of lottery
SYMBOL   lottoHi        = B11                   ' high byte of lottery


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

Reset:
  PINS = %00000000                              ' all off
  DIRS = %00011111                              ' configure outputs

  SEROUT Sio, Baud, ("!!!!!!AP8", %00, "X")     ' stop audio if reset

  PAUSE 20000                                   ' warm-up/inter-show delay
  timer = 0                                     ' clear for PIR debounce


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

Main:
  RANDOM lottery                                ' stir random value
  PAUSE 10
  timer = timer + 10 * PIR                      ' advance or clear timer
  IF timer < 250 THEN Main                      ' wait for valid signal

  Fogger = IsOn
  PAUSE 1000

  SEROUT Sio, Baud, ("!AP8", %00, "P", 0)       ' start audio
  Wiper = IsOn

  timer = 0                                     ' clear for jumping

Thrash_About:
  RANDOM lottery                                ' re-stir random value
  Valve1 = lottoLo                              ' valve1 = lottery.0
  Valve2 = lottoHi                              ' valve2 = lottery.8
  delay = lottery // 251 + 150                  ' 150 to 400 ms
  PAUSE delay
  timer = timer + delay
  IF timer < 8000 THEN Thrash_About

  GOTO Reset


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


' -----[ User Data ]-------------------------------------------------------
Jon McPhalen
EFX-TEK Hollywood Office

ufo8mycow

Did you ever know that you?re my hero,
And everything I would like to be?
I can fly higher than an eagle,
For you are the wind beneath my wings.


ufo8mycow

October 20, 2007, 01:24:43 PM #18 Last Edit: October 20, 2007, 02:34:59 PM by ufo8mycow
Ok I got the board this morning got the sound recorded into slot zero and it will play manually but I cant get it to play with the prop1

livinlowe

Do you have your baud rate jumper off the ap8? do you have all your switches in the open position?
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Did you reconfigure the slot-selection switches -- they all need to be open for control from the Prop-1.
Jon McPhalen
EFX-TEK Hollywood Office

ufo8mycow

I have rechecked everything and the switches are all open, the b/r a1 and a0 jumpers are all off

JonnyMac

Did you change the ULN2803 for a ULN2003 or clip pin 1 of the ULN2003?
Jon McPhalen
EFX-TEK Hollywood Office

ufo8mycow

October 21, 2007, 12:46:03 PM #23 Last Edit: October 21, 2007, 12:58:04 PM by ufo8mycow
yes. And I just ran the ap8 test program and it works perfect but still nothing with the crastebeast program. how can I make it run the debug  like in the test program?

JonnyMac

October 21, 2007, 01:10:24 PM #24 Last Edit: October 21, 2007, 01:12:12 PM by JonnyMac
I found the problem -- sorry, a typo on my part.  You need to change the Sio definition from PIN7 to just 7.  Please, forgive me; this month we have done more business that we could ever imagine and we've both (John B and I) have been run a bit ragged.

SYMBOL  Sio             = 7                     ' SETUP = out, no ULN

This is one of those very subtle errors that is easy to look past; even for those of us with a lot of experience.
Jon McPhalen
EFX-TEK Hollywood Office

ufo8mycow

I tried that and it still isnt working

JonnyMac

Well now I'm really lost... I can see no reason it shouldn't work, especially if you say that the AP-8 test program does work with the same set of connections.
Jon McPhalen
EFX-TEK Hollywood Office

ufo8mycow

I got it. somehow I screwed up and recorded on segment 7.

Thank you for all youre help.

JonnyMac

Jon McPhalen
EFX-TEK Hollywood Office