Skip to content
clovett edited this page Jul 5, 2016 · 23 revisions

Welcome to the firefly wiki!

Arduino based fire works controller designed to communicate with Windows app over XBee serial port.

The windows app allows you to launch the tubes using touch screen, or do programmed sequential launches with different timings. The app is WPF C# and only 350 lines, so it is very easy to modify to add new features.

Messages are five byte messages arranged as follows:

1 Byte header | 1 byte command | 2 byte argument | 1 byte checksum

the header is always 0xFE

The commands are:

  • H for heartbeat, which needs to be sent to the controller at least once a second
  • F for fire, which needs to be paird with the tube number as the arguments as a 16 bit number
  • A which is an ACK message sent from the controller to the computer for every message received
  • N which is NACK sent from the controller to the computer for unknown messages, or tube number out of range
  • I is an 'info' request, controller responds with the # of tubes

Checksum is a right shift once and a xor starting with zero.

    private byte Crc(byte[] buffer, int offset, int len)
    {
        byte crc = 0;
        for (int i = offset; i < len; i++)
        {
            byte c = buffer[i];
            crc = (byte)((crc >> 1) ^ c);
        }
        return crc;
    }

#Enjoy!

This is an actual shot launched by this app on 4th July 2016:

Clone this wiki locally