RSeries astromech firmware
BadMotivator Class Reference

#include <dome/BadMotivator.h>

Detailed Description

Controls a relay to a smoke machine and some LEDs.

Smoke will run for a maximum of 6.5 seconds with a minimum of 5 minute pause in between activations.

ANIMATION(badMotivator)
{
// Temp max volume
DO_COMMAND_AND_WAIT("STtmpvol=100,15", 100)
// Temp stop random sounds on main controller
DO_COMMAND_AND_WAIT("STtmprnd=60", 100)
// Short Circuit MP3 - play sound bank 8
DO_COMMAND_AND_WAIT("ST$08", 500)
// Smoke on and allow smoke to build up in dome
DO_COMMAND_AND_WAIT("BMON", 3000)
// Open pie panels
// Open pie panels
servoDispatch.moveServosTo(PIE_PANELS_MASK, 150, 100, 700);
}, 500)
// Spark fire strip
DO_ONCE({ fireStrip.spark(500); })
// Electrical Crackle MP3 - sound bank 14
DO_ONCE_AND_WAIT({ StealthCommand("ST$14"); }, 500)
// Smoke off
DO_COMMAND("BMOFF")
// Fake being dead for 8 seconds
// Ok We are back!
DO_COMMAND("ST$0109")
// Close pies
// Close pie panels
servoDispatch.moveServosTo(PIE_PANELS_MASK, 150, 100, 2400);
})
}
+ Inheritance diagram for BadMotivator:
+ Collaboration diagram for BadMotivator:

Public Member Functions

 BadMotivator (byte smokeRelayPin)
 Constructor. More...
 
void smokeOn ()
 Turn on the smoke machine. More...
 
void smokeOff ()
 Turn off the smoke machine. More...
 
virtual void handleCommand (const char *cmd) override
 BadMotivator Commands start with 'BM'. More...
 
- Public Member Functions inherited from CommandEvent
 CommandEvent ()
 Default Constructor. More...
 
virtual void handleCommand (String cmd)
 Subclasses should implement this function to process commands specific to their device. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CommandEvent
static void process (char *cmd)
 Calls handleCommand() for each created CommandEvent subclass. More...
 
static void process (const char *cmd)
 Calls handleCommand() for each created CommandEvent subclass. More...
 
static void process (PROGMEMString pcmd)
 Calls handleCommand() for each created CommandEvent subclass. More...
 
- Protected Member Functions inherited from RelaySwitch
 RelaySwitch (byte relayPin, uint32_t pauseTime=0)
 Constructor. More...
 
void relayOn (uint32_t switchOffMS=0)
 Turn on the smoke machine. More...
 
void relayOff ()
 Turn off the smoke machine. More...
 
virtual void animate () override
 Check if smoke machine timer has expired. More...
 
- Protected Member Functions inherited from AnimatedEvent
 AnimatedEvent ()
 Default Constructor. More...
 
void setLoopDoneCallback (AnimatedLoopDone loopProc)
 
- Static Protected Member Functions inherited from AnimatedEvent
static void process ()
 Calls animate() for each created AnimatedEvent subclass. More...
 

Constructor & Destructor Documentation

◆ BadMotivator()

BadMotivator::BadMotivator ( byte  smokeRelayPin)
inline

Constructor.

Member Function Documentation

◆ handleCommand()

virtual void BadMotivator::handleCommand ( const char *  cmd)
inlineoverridevirtual

BadMotivator Commands start with 'BM'.

Implements CommandEvent.

◆ smokeOff()

void BadMotivator::smokeOff ( )
inline

Turn off the smoke machine.

◆ smokeOn()

void BadMotivator::smokeOn ( )
inline

Turn on the smoke machine.

A minimum of 5 minutes have to pass in between activations and the smoke will be automatically stopped after 6.5 seconds.


The documentation for this class was generated from the following file:
DO_START
#define DO_START()
Definition: Animation.h:15
DO_ONCE
#define DO_ONCE(p)
Definition: Animation.h:19
ANIMATION
#define ANIMATION(name)
Definition: Animation.h:14
StealthCommand
void StealthCommand(String cmd)
Definition: ReelTwo.h:430
DO_WAIT_SEC
#define DO_WAIT_SEC(sec)
Definition: Animation.h:25
DO_COMMAND_AND_WAIT
#define DO_COMMAND_AND_WAIT(cmd, ms)
Definition: Animation.h:35
DO_END
#define DO_END()
Definition: Animation.h:39
DO_ONCE_AND_WAIT
#define DO_ONCE_AND_WAIT(p, ms)
Definition: Animation.h:20
DO_COMMAND
#define DO_COMMAND(cmd)
Definition: Animation.h:34