#ifndef __FIREFLY_H__
#define __FIREFLY_H__

/*
       NEURAL NETWORK DIAGRAM

       +------------------ NN_INPUTS  - input layer
       |   +-------------- NN_HIDDEN  - hidden layer
       |   |   +---------- NN_OUTPUTS - output layer
       v   v   v
0.M/F  o/\             <-- is firefly male or female
1.FF0  o\/\  /\o 0.FF0 <-- 3-bit number of who's calling,
2.FF1  o/\/o/\/o 1.FF1 < | and who to respond to, ideally
3.FF2  o/\/o/\/o 2.FF2 < \ the numbers should be the same
4.CL0  o/\/o/\/o 3.CL0 <-- 3-bit number of what call was
5.CL1  o/\/o/\/o 4.CL1 < | used, and which to use to respond.
6.CL2  o/\/o/\/o 5.CL2 < | ideally it should be able to determine
                         | whether it's male or female from the
                         \ call.
*/

// firefly settings
#define FF_COUNT           6

// firefly bits, do not modify!
#define FF_SEX             0
#define FF_CALLING         1
#define FF_WAITING         2
#define FF_RESPONDING      3
#define FF_READY           4
#define FF_DONE            5

// neural network settings
#define NN_INPUTS          7
#define NN_HIDDEN          5
#define NN_OUTPUTS         6
#define NN_THRESHOLD       1
#define NN_ACTIVATION(SUM) ((SUM) >= NN_THRESHOLD ? 1 : -1)

// firefly functions
void fireflies_setup();
void fireflies_update();
unsigned int fireflies_brightness(unsigned int firefly);

#endif
