RSeries astromech firmware
Zapper Class Reference

#include <body/Zapper.h>

Detailed Description

Controls a relay to a spark gap igniter to create some actual sparking.

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

ANIMATION(zapper)
{
// Zapper arm
DO_COMMAND("BZARM")
// Zapper on
DO_COMMAND("BZON")
// 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 Zapper:
+ Collaboration diagram for Zapper:

Public Member Functions

 Zapper (byte idPin, byte relayPin)
 Constructor. More...
 
bool isAttached ()
 
void zapperArm ()
 Arm zapper. More...
 
void zapperDisarm ()
 Disarm zapper. More...
 
void zapperOn ()
 Turn on the zapper. More...
 
void zapperOff ()
 Turn off the smoke machine. More...
 
virtual void handleCommand (const char *cmd) override
 Zapper Commands start with 'BZ'. More...
 
virtual void animate () override
 Perform a single frame of zapper animation. 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...
 

Constructor & Destructor Documentation

◆ Zapper()

Zapper::Zapper ( byte  idPin,
byte  relayPin 
)
inline

Constructor.

Member Function Documentation

◆ animate()

virtual void Zapper::animate ( )
inlineoverridevirtual

Perform a single frame of zapper animation.

Implements AnimatedEvent.

◆ handleCommand()

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

Zapper Commands start with 'BZ'.

Implements CommandEvent.

◆ isAttached()

bool Zapper::isAttached ( )
inline

◆ zapperArm()

void Zapper::zapperArm ( )
inline

Arm zapper.

Extra step to make sure zapper is not fired while inside the body.

◆ zapperDisarm()

void Zapper::zapperDisarm ( )
inline

Disarm zapper.

Extra step to make sure zapper is not fired while inside the body.

◆ zapperOff()

void Zapper::zapperOff ( )
inline

Turn off the smoke machine.

◆ zapperOn()

void Zapper::zapperOn ( )
inline

Turn on the zapper.


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
DO_WAIT_SEC
#define DO_WAIT_SEC(sec)
Definition: Animation.h:25
DO_END
#define DO_END()
Definition: Animation.h:39
DO_COMMAND
#define DO_COMMAND(cmd)
Definition: Animation.h:34