I based the design of the IR protocol off of the constraints of the IR
sensors. Since the minimum number of carrier pulses is 10
acording to the datasheet. I made the smallest symbol 10 56 kHz pulses.
There is also a minimum required gap between IR transmision of 10
carrier pulses. So I decided to use the down time to
transmiti data as well. So the basic waveform is a PWM with each
symbol between 10 and 40 carrier pulses. Each symbol represents
two bits of data, as shown. There is also a 20 pulse header to
mark the start of the packet. In theory a receiving
microcontroller could base the timing for decoding the waveform off of
the initial header sybol.
Each packet contains 32 bits of information or 16 symbols, plus the header. The breakdown is
Bits
Data
0-3 (4)
Team numbers (0-14: team 15 is reserved for referee input)
4-13 (10)
Player ID (0-1023)
14-21 (8)
Damage (0-255)
22-25 (4)
Damage Type (0-15)
26-31 (6)
Checksum
The damage types are 0:
Knife (Think about a stick with really low powered LEDs.
You wouldn't have to touch someone but you would have to get
really close.) 1: Pistol 2: Rifle 3: Sniper 4: Emplacment 5: Gernade 6: Mine 7: Anti-Armor 8: Medic (- Damage) 9: Engineer (- Armor Damage) 10-15: Possbile Expansion.
There are a lot of options but I think reading through
some statistics at the end of games would be more fun. Also it
allows someone to make the game more simulation than tag. There
are two types of damage and I envision the damage working similar to
this damage tree.