- if you need nRF24 radio module you must install [RF24 library](https://github.com/maniacbug/RF24);
- beta version, with LED brightness control, makes use of [TimerOne library](https://github.com/PaulStoffregen/TimerOne);
Please refer to [libraries guide](https://www.arduino.cc/en/Guide/Libraries) for installation.
## Optionals
If you make use of nRF24L01 radio module you must uncomment following line
```
// #define HAS_WIFI
```
then compile the code and load onto Arduino Mega.
## Tech specs
PC (i.e. ArcheryClock application) sends commands to the Arduino to update the LED panel. Every command (package) is formatted as an ASCII number between 0 and 65535 (16-bit), terminated with newline (<code>\n</code>).
Arduino makes integer conversion and parses the command following below specification:
### DigitsValue Package
![Digits Value](docs/DigitsValue.svg)
Identified by first bit equal to zero. Contains information regarding seven segment digits:
- S - side: determines if the package is directed to left or right panel (if presents);
- O - sideOverride: flag the package to be accepted by both panels;
- M - minutes:
- Right Digit: numeric value of rightmost digit;
- Mid Digit: numeric value of central digit;
- Left Digit: numeric value of leftmost digit;
### TrafficValue Package
![Traffic Value](docs/TrafficValue.svg)
First bit is set to one, followed by two zeros. Contains information regarding traffic lights and archer group letters:
- B - buzzer: turns on the horn;
- Traffic Left: traffic light LEDs for left panel. Bit 4 represents green, followed by orange and red;
- Traffic Right: traffic light LEDs for right panel.
- Archer Groups: each bit, starting from rightmost, represents an archer group from A to F. E and F are currently not supported by the hardware.
### StateValue Package
![State Value](docs/StateValue.svg)
First four bits are set to one. Contains information regarding panel settings and has no direct visive output:
- ABCD: discriminates game phases. If emergency, this is set to 6;
- Competition: expresses the current type of competition (i.e. FITA);
- _three bits are ignored_
- Group Number: number of playing archer groups. Since one group is always present, 0 represent one team, 1 represent two and so on.
### Others
ArcheryClock may send other packages but are ignored by this code due to lack of hardware support.