November 22, 2024, 09:24:39 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Can I read a program from a Prop-1?

Started by SpookyDad, October 25, 2007, 07:02:05 PM

Previous topic - Next topic

JonnyMac

Tragically, you can't use the BS1 Serial Adapter as an interface to the uMP3 -- trust me, I tried.  I've posted lots of serial examples with the uMP3; have a look at those to see what's happening.  If you can get a USB2SER or other compatible device for reconfiguring, I'll rewrite your code.  Forgive me for not doing it now, but I can't devote the time to a program that won't actually get used -- that will change on November 1.   ;D
Jon McPhalen
EFX-TEK Hollywood Office

SpookyDad

I understand completely. I have gone back to the original configuration and it is working ok now.
It is 90% of what I wanted it to do. 90% and working is better than 100% theory and not working.

I will order a USB adapter next week.

Good luck on everyone else's programs.

Once again thanks for all your help.

Neil

SpookyDad

I managed to get the program working the way I wanted to. The prop was an alligator on a swivel and extending arm. It was the absolute most scary prop of the entire evening. It scared 95% of the TOTs. We had one confirmed peetality. It would not have been possible without the Prop-1 controller.

Here is the final code. (after the first cycle through the program, it worked flawlessly the entire evening.

' {$STAMP BS1}
' {$PBASIC 1.0}\

' **************************************************************
' * Pop-up Skelly using the uMP3 for sound
' *
' * by Neil Gillbanks
' *
' * October 25, 2007
' *
' **************************************************************
'
' **************************************************************
' * Pin Configuration:
' * Pin 7- N.O. pushbutton to ground (pulled high)
' * Pin 6- Nothing
' * Pin 5- Red LED
' * Pin 4- Upper Relay (Plug)
' * Pin 3- Lower Relay (Plug)
' * Pin 2- Green LED
' * Pin 1- uMP3 Play file B0001.mp3
' * Pin 0- uMP3 Play file B0000.mp3
' **************************************************************

' *******************************
' * I/O Definitions             *
' *******************************
   SYMBOL LED = 2
   SYMBOL Light = 4
   SYMBOL AirCannon = 3
   SYMBOL RLED = 5
   SYMBOL Trigger = PIN7
   SYMBOL No = 0
   SYMBOL Yes = 1
   SYMBOL Ambient = PIN0
   SYMBOL Roar = PIN1

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

SYMBOL  tick           = B2                    ' Pause


' *******************************
' * Main Program                *
' *******************************

Tick = 0
HIGH Roar
LOW LED
LOW Light
LOW AirCannon

  DEBUG "Turn on LED" , CR
  HIGH LED
  DEBUG "Play Ambient Sound" , CR
  LOW Ambient


MainLoop:

  Tick = Tick + 1
  DEBUG Tick, CR
  IF Trigger = YES THEN Triggered
  IF Tick < 30 THEN MainLoop                 ' The length of the first sound file
  HIGH Ambient
  DEBUG CR,"Play Ambient Sound" , CR
  LOW Ambient
  Tick = 0

  GOTO Mainloop:

Triggered:
  DEBUG CR, "Triggered"
  DEBUG CR, "Turn on Light" , CR
  HIGH Light
  PAUSE 1500
  DEBUG "Play Roar Sound" , CR
  LOW Roar
  PAUSE 1500
  DEBUG "Turn on Air Cannon" , CR
  HIGH AirCannon
  HIGH RLED
  PAUSE 200
  DEBUG "Turn off Air Cannon" , CR
  LOW AirCannon
  LOW RLED
  DEBUG "Turn off Light" , CR
  LOW Light
  DEBUG "Turn off LED" , CR
  LOW LED
  PAUSE 2000
  HIGH Roar
  HIGH Ambient
  Tick = 0
  GOTO Mainloop