# MonsterShield Expansion Board



## Xpendable (Sep 19, 2006)

I've been away for awhile but wanted to let you know what I've been working on. I'm designing an expansion board for the MonsterShield prop controller that will allow you to control up to 16 relay outputs from a single MonsterShield. The expansion board has connectors for 3 additional 4-relay modules, thereby adding 12 relays to your existing 4. You will be able to purchase the expansion board with 0, 1, 2, or 3 relay modules based on your needs, and you can add the extra relay modules at any time. The expansion board also adds 3 additional input triggers (for a total of 4) that can be used in a number of different ways. There's also an expansion port for connecting a $15 servo controller module from Adafruit which will allow you to add 16 servos to the MonsterShield. And... you can daisy chain a few of those boards together to run more servos than 16 if you need to. Plus those boards will let you control and dim LED's (even RGB led's!). The expansion board also has additional EEPROM memory, a header for the i2c bus, and a header for the serial port. And yes, the expansion board will work with all existing MonsterShields, although you'll have to load the new firmware to use it.

I'm also coming out with an all-new firmware that will come with an extremely easy to use Arduino API giving you full access to the hardware AND record / playback capabilities. This gives you access 4, 8, 12, or 16 relays, the 3 input buttons on the MonsterShield, the 7-segment display, the EEPROM chip(s), and playback & record functions for animations. Just how easy is this to use? Here's a couple of examples:


```
// Example showing manually scripting animation in response
// to trigger 0.

#include "MonsterShield.h"

MonsterShield monster;

void setup()
{
   monster.init();
}

void loop()
{
  monster.waitOnTrigger(0, HIGH);  // Wait until trigger 0 goes HIGH
  monster.setDigitChar('P');  // Display P on the 7-segment display
  monster.mp3Play(14);   // Start playing 014.mp3 on MP3 player
  
  monster.setRelay(0, HIGH);
  monster.setRelay(3, LOW); 
  monster.setRelay(15, HIGH);

  monster.latchRelays(); // Execute the relay state changes!

  delay(3000);  // wait 3 seconds
  monster.setRelayAndLatch(13, HIGH); // Immediately switch relay 13 ON

  delay(5000); // wait 5 seconds
  monster.mp3Stop();  // Stop MP3 player

  monster.setRelaysAndLatch(0x00);  // Turn off all 16 relays at once!

}
```
Another example:

```
// Example showing playback of animation previously recorded on EEPROM
#include "MonsterShield.h"

MonsterShield monster;

void setup()
{
   monster.init();
}

void loop()
{
  monster.waitOnTrigger(0, HIGH);  // Wait until trigger 0 goes HIGH
  monster.playAnimation(3); // Play animation recorded on slot 3!
}
```
A more complex example showing you how you can manage the
animation loop yourself and inject your own code in between each animation
step. How cool is that?!?!

```
// This example waits for a trigger to begin playing an animation.
// As the animation is being "stepped" through, it checks to see
// if trigger 1 goes HIGH.  If it does, it PAUSES the animation!  When
// trigger 1 goes LOW, the animation RESUMES!

#include "MonsterShield.h"

MonsterShield monster;

void setup()
{
   monster.init();
}

void loop()
{
  monster.waitOnTrigger(0, HIGH);  // Wait until trigger 0 goes HIGH
  monster.stepAnimationInit(3); // Play animation from slot 3
 
  // Each call to stepAnimationNext() will block and wait until
  // the appropriate time for the next animation step to occur, and
  // then executes the animation (relay state changes) for that step.  
  // If the appropriate time has already passed, then it executes that step
  // immediately and exits -- this allows the animation to catch back up 
  // to where it is supposed to be in case YOU took too long!

  while (monster.stepAnimationNext() == true)
  {
    // Do your own stuff in between each step of the animation!

    if (monster.triggerState(1) == HIGH)
    {
       // Trigger 1 just went HIGH.  PAUSE animation until trigger 1 goes LOW.
       monster.stepAnimationHold(); // Freeze the timer.
       monster.waitOnTrigger(1, LOW); // block until trigger goes low.
    } 
    
  }
}
```
Those are just a couple of ideas. You could also implement an abort animation, or string together several different animations into 1 giant animation, have complex conditional logic... whatever.

Our new firmware is actually using this very same API to do all of its "magic".

Another thing that the new firmware will give you is the ability to record your tracks 1 to 4 tracks at a time, laying down each new track(s) while the previously recorded tracks are playing in real time. This is how you can use the keypad to "keybang" in all 16 tracks for an animation.

The Windows track editor software for the MonsterShield is also getting a HUGE update. There will be a waveform display for your mp3 file displayed along with the animation tracks.

I believe that these updates are going to make the MonsterShield one of the most impressive and versatile prop controllers out there.


----------



## Xpendable (Sep 19, 2006)

While not too impressive (yet), here's a quick video showing a MonsterShield running with a prototype expansion board firing 16 relays and controlling 2 servos. Work in progress.


----------



## The Pod (Sep 15, 2009)

Can't wait to get my hands on this new version......


----------



## Jack Is Back (Jun 21, 2011)

That looks really good. I'm waiting patiently to get my hands on one of these boards.


----------



## Xpendable (Sep 19, 2006)

I demo'ed the prototype at a Chicago Haunt Builders event on Saturday...


----------

