November 21, 2024, 06:55:35 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.


Working on an elevator Simulator...

Started by Ryanm0085, January 31, 2009, 01:21:53 PM

Previous topic - Next topic

Ryanm0085

Main:

SEROUT 0,84,["VPF test.mp3",CR]           'Play a file named "test.mp3"
PAUSE 5000
SEROUT 0,84,["VP",CR]                     'Pause playback of "test.mp3"
PAUSE 3000
SEROUT 0,84,["VP",CR]                     'Resume playback of "test.mp3"
PAUSE 5000
SEROUT 0,84, ["VSV 30",CR]                'Reduce playback volume
PAUSE 5000
SEROUT 0,84, ["VSV 0",CR]                 'Return playback volume to full
PAUSE 5000
SEROUT 0,84, ["VST",CR]                   'Stop playback of "test.mp3"

SEROUT 0,84, ["V3A",CR]                   'Command to play all mp3 files.  It will play whatever file it first finds
PAUSE 5000
SEROUT 0,84, ["VSF",CR]                   'Skip forward one track.  It will play the next file
PAUSE 5000
SEROUT 0,84, ["VSB",CR]                   'Backs up to the start of this track.
PAUSE 5000
SEROUT 0,84, ["VST",CR]                   'Stop playback

SEROUT 0,84,["VPF test2.mp3",CR]          'Play a file named "test2.mp3"
PAUSE 2000
SERIN 1,84, [WAIT (">")]                  'Waits for "test2.mp3" to stop playing
PAUSE 2000

GOTO Main


That is the code from his website.  im guessing its the 84 but im not positive

Ryanm0085

Wow...ok i figured out why the VMusic players were not being detected.  The baud rate was only set on 9600.  So now here's the kicker.  You can update the baud rate by changing the firmware.  You have to download the firmware from Vinculum's website.  Then you have to download the Customizer program which allows you to change the firmware.  Then you save the modified firmware to a Thumb Drive and and run it on the VMusic Player.  Heres the part that almost casued the VMusic players to change there physical shape(otherwise smash them).  My one VMusic player takes the firmware just fine.  It updates, I connect it, and hey the Prop-2 finally detects it.  Now the second one on the otherhand, won't freakin update.  Talk about being frustrated.  One works the way it should and one doesnt.  So doing research, somewhere i read that under certain circumstances, the VMusic player will lock out and not be able to update.  Why the hell would that happen.  Apperently it must just radomly decided its fed up with being changed cause the other one went through the same changes.  So now i have to buy a cable from them that plugs into the Vmusic player to reset it.  I think they should provide it free when you buy the player since its a gamble on how they're gonna work.  So now I'm at a hault again.  The website says the cable is the same as the USB-to-Serial adapter from you guys.  I just have to find out what pins r what.  If i figure it out i will post it.  I will try and make a 9 Pin female plug to a VMusic plug.  This way i can still use the adapter.  Someone really needs to develope a nice, inexpensice and stable Mp3 player. 

JonnyMac

You now know why I am so fiercely opposed to our customers using the VMUSIC -- I've been through all of this.  Luckily, however, I have one of those cables (had it for another device/project) and I was able to recover my module. 

Now... if your units work at 9600 baud then use that; the code I wrote for you can be modified more easily than the VMUSIC player.
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

i will try and change the baud rate in a little bit...just got home from work...about the cable to change the VMusic player, isnt that pretty much the same as the usb-to-serial adapter u offer except urs has a 9-pin connector?  it seems like it would be that all i would need is to get the pin configuration right...

JonnyMac

No, it's just the opposite; that cable is USB  to TTL serial, the [Parallax] adapter that we carry is USB to RS-232 serial -- different voltages and polarities on the output from TTL serial.
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

ok...im trying to figure out how to change the program to 9600 but im not having any luck...anyone help?

BigRez

Assuming you're changing the lines similar to the following one and want to change from 9600 to 2400 baud:

SEROUT 0,84,["VPF test.mp3",CR]           'Play a file named "test.mp3"

Then you'll want to change the  84  value (which represents true 9600 baud 8 bit no parity) to  396   (which is for true 2400 baud 8-bit no parity).

You can find this info on page 419 of the PBASIC Reference Manual.

Ryanm0085

February 09, 2010, 04:33:22 PM #52 Last Edit: February 09, 2010, 04:44:16 PM by Ryanm0085
thanks bigrez but i am actually trying to cahnge the program Jon wrote for me on the first page...its set to 38400 and i need to change it to 9600...all i can say is VMusic is crap and very frustrating...one time it works one way, the next nothing, then you put it back the same way and still nothing...Holy Crap i really wanna break something!!!!

BigRez

February 09, 2010, 04:47:55 PM #53 Last Edit: February 09, 2010, 04:55:35 PM by bigrez
--- Modified---
Actually, after looking at the code again, I'm not sure if the following will work.  You could just try to use a value of 396 for the VMBaud in the second option below.
--------------

OK, in that case, you'll want to change the line

Baud            CON     Open | T38K4            ' for VMUSIC + DC-16

so that it reads

Baud            CON     Open | T2400            ' for VMUSIC + DC-16

Note that doing so will also change the baud rate for the DC-16. This may be ok that they're both at 2400 but I'm not sure.  So if not, you could create a separate line for each as follows:

VMBaud          CON     Open | T2400            ' for VMUSIC
DCBaud          CON     Open | T38K4            ' for DC-16

and then of course change the VMusic lines to use the VMBaud variable and the DC-16 line to use the DCBaud variable.

Ryanm0085

yeah once again...doing that and nothing works...change it back, nothing works.  put it back to when it did work...nothing works.  What a crappy piece of technology.  Vinculum should offer refunds for their junk products...

JonnyMac

They made the serious mistake of calling me one day asking me if EFX-TEK wanted to distribute that product.  Boy, were they surprised at the response.  Apparently the sales department and engineering department don't keep in touch as I had sent many emails to their engineering team complaining about serious problems with that product.
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

your not kidding...i finally found some time to mess with this stuff and it doesnt work.  now i have to order that cable from them cause there product decided it doesnt wanna work right.  Unbelievable...i hope now that i have to wait for the cable that it actually will fix the darn problems.   If not im gonna grind up there precious components and send them to Vinculum...

Ryanm0085

Alright I have made serious head way on the elevator sim.  The frame is finished, painted, and piped for air.  Tested it with 10 people and it works great.  Now i will be building the actual car to mount to the frame and then on to the wiring and programming.   IT WILL BE FINISHED THIS YEAR...  Having some problems decidng on wether to buy the uMP3, the rMP3, or the AP+16.  I'm hoping to get some pictures and video of this thing in operation....

JonnyMac

Serious question asked with a grin: will those other vendors write the code you need to "talk" to their audio players?.... 

Now, everybody knows that we will help, to the best of our ability, with anything connected to one of our controllers.  Shouldn't other vendors have the same kind of support policy?  ;D
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

July 24, 2010, 05:51:20 PM #59 Last Edit: July 24, 2010, 06:54:33 PM by Ryanm0085
Alright eveyone.  I am down to the last few details on this thing.  Everything is built and the main control board is ready.  I am running a Prop-2, a DC-16, and a uMP3 player, and a relay board.  Keep in mind i designed this project off of a real elevator, everything from the size to the sequence.  It may seem pretty advanced but should be awesome when completed.  Once its done i will post pictures and video of it in operation.  I decided to scrap the E-Stop sequence on the prop-2 and designed a relay latch that will cut the power to the boards when pushed.  Also i have a battery back-up system so if the AC power is removed it will cut power to the boards, but will still open the down solenoid and open the 12v doors.  I think i have covered just about everything, except the program.  I dont know if i should have started a new thread becuase this ones getting long, but here we go...
PROP-2
P0 - NO Trigger
P1 - NO Trigger
P2 - NO Trigger
P3 - Lights On (wired on a relay so when the relay is open, the lights stay on.  When P3 is high, the lights go off)
P4 - Inside Light Toggle (Toggles Black lights and Flourescent Lights)
P5 - Outside Light Toggle (Toggles High Hat and Strobe Light)
P6- Up Solenoid
P7 - Down Solenoid (on a NC relay.  When power is cut the elevator will return down)
P8 – Relief valve
P9 – Up Arrow
P10 – Door Toggle (When high doors will close, when low doors will open)
P13 – uMP3
P14 – uMP3
P15 – serOut

DC-16
P0-P10 are connected to a 7 segment led display.  This is not to important.  If you can show how to get the serout commands I can create sub-routines for the numbers.

On initialization I would like everything to fire about 2 seconds individually to insure everything is working.  Also P7, P10, and P3 should be set high.

Initilization:
Turn Off P10
Flash through P0-P10 on the DC-16.  Fast is fine
Turn Off P3
Fire P4 (2 seconds)
Fire P5 (2 seconds)
Fire P9 (2 seconds)
Turn On P3
Turn On P10
Turn Off P7
Fire P6 (2 seconds)
Turn On P7
Fire P8 (2 seconds)
Start mp3 (1.mp3)

Routine:
When Trigger 0 is pushed:
Turn Off P3
Wait 3 seconds
Turn On P9
Wait 1 second
Turn off P10

When Trigger 1 is pushed:
Immediately Start     2.mp3
Wait 3 Seconds
Turn Off P9
Turn On p10
Turn On P9.dc16
Wait 2 Seconds
Fire P6 for 2 seconds
Turn Off P7
Turn Off P3
Turn On P4
Wait 3 Seconds
Turn On P3
Turn Off P10

Trigger 3 (reset to wait for triiger one):
Turn on P10 and P7
Turn Off P3 and P4
Turn off all dc-16 outputs
Start 1.mp3

This is very basic of what I need.  After this code, I will be able to fine tune and should have no problem adding things where I need them.  Not all the channels were used, but I will add them in once I start fine tuning.  I appreciate all of your help Jon as well as everybody elses.  you guys are great.  .  This should be one bad ass ride once its complete...im very excited...