November 23, 2024, 11:07:03 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.


Interactive Hammer Trap Room Project

Started by JoshHHA2014, August 15, 2014, 06:43:07 PM

Previous topic - Next topic

JoshHHA2014

August 15, 2014, 06:43:07 PM Last Edit: August 15, 2014, 06:47:50 PM by JoshHHA2014
Hey guys, I'm currently working on a room that my goal is to be interactive in order for customers to be unlocked from the room. I need some help coding and connecting Prop-2 and Prop-1 controllers. There are more inputs and outputs needed than Prop-2 can handle on its own.

Specifications\Show Sequence

Eight People enter the room, once door closes the game starts by door sensor. Exit door is magnetically locked before they enter. A 20 second introduction video starts with directions. A new 20 second game timer will start at end of video.

During the game timer 4 sets of buttons will light up on 4 bench seats with 4 sets of hammers above them. If they don't push buttons at same time then their hammer goes off a couple times, air cannon goes off, and a 3-5 second air chisel vibrates their seats. But each set of buttons can only set the prop off once. If they push all buttons at the same time all the hammers go crazy, air cannons go off, chisels vibrate seats, and victory video will play. If the timer runs out deadly gas will pour into the room (fog machine), hammers go crazy, air cannons go off, and chisels vibrate seats. At the end of either outcome the exit door magnet will disengage and an air cylinder will open the door.

Now once exit door has opened a motion sensor in room will help indicate when room is clear. An indicator LED outside entrance door will start slowly blinking when motion sensor sees motion. If still motion after 15 seconds, indicator LED will flash faster for traffic flow management. Once room is empty exit door will close, magnet lock engages, and LED indicator turns on solid. At that point once the entrance door has been opened for more than a second the program should restart, waiting for door to shut for game start.

Also there is a button on the exit door that will disengage magnet and open door at any time. This will be used only as a bypass in case of an emergency.


Inputs

- Start door sensor

- Front Trap 1 Buttons
- Back Trap 1 Buttons

- Front Trap 2 Buttons
- Back Trap 2 Buttons

- Room motion sensor for exit door

- Exit door bypass button


Outputs

- LEDS in Trap Buttons

- Intro Video

- Air Cannon Trap 1
- Air Cannon Trap 2

- Air Chisel Trap 1
- Air Chisel Trap 2

- Trap 1 Front Hammer
- Trap 1 Back Hammer

- Trap 2 Front Hammer
- Trap 2 Back Hammer

- Fog Machine

- Won Game Video

- Indicator LED (Outside entrance door)

- Exit door magnet

- Exit door cylinder



JoshHHA2014

August 15, 2014, 08:10:44 PM #1 Last Edit: August 15, 2014, 08:15:35 PM by JoshHHA2014


Note:

I have already wrote a program for this show from start to finish with bypass and empty room sensor. It is written sloppy as JonnyMac pointed out and he is right since if anyone else read it besides me it would be very hard to follow. But still wont work since coded assuming Prop-2 had enough I/O pins. Now need to alter code to work with Prop-1 to add the extra I/O pins needed to operate the whole room.






JackMan

I could be wrong but I don't think this is doable with a Prop-1/Prop-2 combo. From your explaination there's a lot going on at the same time. I think a pair of HC-8+'s would be much better suited for this. I'm sure Jon will chime in on this.  ;)

JoshHHA2014

August 16, 2014, 07:41:06 AM #3 Last Edit: August 16, 2014, 07:59:00 AM by JoshHHA2014
Quote from: JackMan on August 16, 2014, 06:55:08 AM
I could be wrong but I don't think this is doable with a Prop-1/Prop-2 combo. From your explaination there's a lot going on at the same time. I think a pair of HC-8+'s would be much better suited for this. I'm sure Jon will chime in on this.  ;)

I had talked to Jon yesterday on the phone about this project before I had signed up on forums and posted my specs here. He did say I could get this to work with the combo but yes he did mention the HC8 would benifit me greatly.

Here is the code that I have written so far on this room.

Note:

I/O pins are undefined in script so it is impossible to compile/test which is my problem. Even if I defined "fake" pins it still wouldn't matter due to the lack of I/Os on the Prop-2 controller stand alone. But, that being said feel free to look over it if you can follow from reading above specs and give any further suggestions.

If I do absolutely need the HC-8+ to have the room functioning exactly how I want it to, I will order it. I already planned on ordering a few of them with future projects in mind after talking with Jon.

JackMan

Well, I have never owned a Prop-2 nor have I learned to write code for it so I'm not much help there. I do know that for what you want to accomplish, there seems to be quite a few tasks that could have to be executed at any given time, no matter where the program may be when they are called for. For that reason, I think the HC-8+ would be a better choice due to having 8 separate cogs in the Propeller Chip. Sorry I'm not much more help than that, but I'm sure Jon will steer you in the right direction.  8)

bsnut

Quote from: JoshHHA2014 on August 16, 2014, 07:41:06 AM
Quote from: JackMan on August 16, 2014, 06:55:08 AM
I could be wrong but I don't think this is doable with a Prop-1/Prop-2 combo. From your explaination there's a lot going on at the same time. I think a pair of HC-8+'s would be much better suited for this. I'm sure Jon will chime in on this.  ;)

I had talked to Jon yesterday on the phone about this project before I had signed up on forums and posted my specs here. He did say I could get this to work with the combo but yes he did mention the HC8 would benifit me greatly.

Here is the code that I have written so far on this room.

Note:

I/O pins are undefined in script so it is impossible to compile/test which is my problem. Even if I defined "fake" pins it still wouldn't matter due to the lack of I/Os on the Prop-2 controller stand alone. But, that being said feel free to look over it if you can follow from reading above specs and give any further suggestions.

If I do absolutely need the HC-8+ to have the room functioning exactly how I want it to, I will order it. I already planned on ordering a few of them with future projects in mind after talking with Jon.

I will take look at your program later on today.
Quote from: JackMan on August 16, 2014, 06:55:08 AM
I could be wrong but I don't think this is doable with a Prop-1/Prop-2 combo. From your explaination there's a lot going on at the same time. I think a pair of HC-8+'s would be much better suited for this. I'm sure Jon will chime in on this.  ;)
The Prop-1 can be used as an input broad to talk to Prop-2 serially and the Prop-2 will receive serial data from the Prop-1.

QuoteI had talked to Jon yesterday on the phone about this project before I had signed up on forums and posted my specs here. He did say I could get this to work with the combo but yes he did mention the HC8 would benifit me greatly.
I will also do a HC-8+ program later on. I may even do it ladder logic for the HC-8+ (Propeller Chip the brain of the HC-8+)   
William Stefan
The Basic Stamp Nut

JoshHHA2014

That would be much appreciated, thank you!
Let me know if you have any further questions
I'm going to be working more on the code this morning

JonnyMac

Your requirements, as I understand them, exceed the capabilities of the Prop-2 controller. As soon as you introduce something like a game timer (that has to run while other things are happening), the Prop-2 is out of the equation. The Prop-2 is a single threaded controller and cannot keep time while doing other things. In the past -- but for very simple projects -- I've used a complex state machine in a Prop-2 to keep track of time, but it's incredibly difficult code to write and for others to understand. Even then, I don't think it would work for your program due to the requirement of handling slave outputs.

The HC-8+ on the other hand, has 8 processors and a built in counter that can be used for precise timing. It has eight inputs and eight outputs. You could use a slave HC-8+ (connected via the RS-485 port) to handle another eight outputs using DMX mode which means that you could use an off-the-shelf HC-8+ as the slave; no programming would be required for it.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

August 17, 2014, 09:58:33 AM #8 Last Edit: August 17, 2014, 10:07:42 AM by JonnyMac
QuoteHe did say I could get this to work with the combo but yes he did mention the HC8 would benifit me greatly.

At that point I didn't really understand there was a game time requirement -- that changes everything, especially when dealing with variable inputs like human behaviors. In your program you have chunks that look like this:

  DO WHILE (ft2 = ison) AND (tix3 > 0)
    HIGH ac2                           
    HIGH ach2                         
    HIGH fhb2                         
  LOOP


If you evaluate the code very carefully, you'll find it's impossible to keep accurate track of time.  The Propeller takes care of timing, as well as monitoring something like an E-switch. When you have people locked in a room that's a good idea.

The Prop-1 and Prop-2 are great for simple sequential and even randomized prop behaviors. Keeping track of time is out of the question. I've been programming BASIC Stamps for 20 years, so I can speak with some authority.

All that said, we can keep poking at the Prop-2; perhaps there is a modification of your spec that will work. If we can make it work, the Prop-2 would handle the inputs and eight outputs, and the slaved Prop-1 would handle seven additional outputs.
Jon McPhalen
EFX-TEK Hollywood Office

JoshHHA2014

Yeah I have been reading and researching the Prop-2 controller for the last day, coming to that conclusion as well.
Also agree that I had thrown together that code in a days time, hoping it would work.

Ordering five HC-8+s on Monday, so if you could help me with programming the room keeping that in mind that would be awesome.

JonnyMac

August 17, 2014, 10:41:27 AM #10 Last Edit: August 17, 2014, 10:43:16 AM by JonnyMac
Of course. What I will continue to ask is that you refine and keep explaining your concept. What makes perfect sense in your head may not be clear to myself and others. As I told you on the phone, the specification is the most difficult part of the project, especially when providing a specification for others.

Make sure that you order a Prop-Plug as well so that you can program your master HC-8+. The second will run in DMX mode (outputs only) and does not need to be reprogrammed as the default programming has a DMX mode (set SM switch to ON).

Quotekeeping that in mind that would be awesome

The HC-8+ is all about "awesome" -- this is why Legoland uses it (with an AP-16+) in all of their animations now -- and they're sending them all over the world for kids to enjoy.
Jon McPhalen
EFX-TEK Hollywood Office

JoshHHA2014

Quote from: JonnyMac on August 17, 2014, 10:41:27 AM
What I will continue to ask is that you refine and keep explaining your concept. What makes perfect sense in your head may not be clear to myself and others. As I told you on the phone, the specification is the most difficult part of the project, especially when providing a specification for others.

Understood, and yes these show guidelines are coming from the owners of HHA. So the order the show/game is stated in my first post is exactly how they would like to run. If you do need me to explain something in particular, please don't hesitate to ask.

Quote from: JonnyMac on August 17, 2014, 10:41:27 AM
Make sure that you order a Prop-Plug as well so that you can program your master HC-8+. The second will run in DMX mode (outputs only) and does not need to be reprogrammed as the default programming has a DMX mode (set SM switch to ON).

Okay, will add the Prop-Plug to the order list. Glade you informed me before we placed our orders.