
This tutorial should take approximately 30 minutes to complete.
The ability to receive a clone signal was introduced in the IR tutorial – https://crosscode.club/2025/03/24/laser-tag-c11-ir/. However, this feature is not particularly useful unless you can also send the signal. In this tutorial, we will create a toggle switch on the Milestag webpage that will switch the tagger into “clone” mode. This will allow the settings from one tagger to be distributed to other taggers.
When a clone signal is received by a tagger or a series of taggers, all affected taggers will have their game settings modified simultaneously. This provides a quick and efficient way to change settings, especially when a different style of game is required. The clone signal is 43 bits long, which is sufficiently lengthy that the IRremoteESP8266 library must handle it in raw format for both sending and receiving.
Byte Number | Item | Value | Description |
---|---|---|---|
0 | Identifier | 0x87 | Must be this value |
1 | Identifier | 0xD4 | Must be this value |
2 | Identifier | 0xE8 | Must be this value |
3 | RESERVED | ||
4 | Volume | 0-5 | 0 = Loudest, 5 = quietest |
5 | Field ID | 0-1 | 0x00 = A, 0x01 = B |
6 | RESERVED | ||
7 | RESERVED | ||
8 | Kill LED | 0-60 | Kill LED timeout in seconds (0-60) |
9 | Sound Set | 0-2 | Sound Set, 0=Military, 1 = Sci-Fi, 2 = Silenced |
10 | SRK Damage | 0-255 | Mapped |
11 | SRK Range | 0-255 | Mapped |
12 | Flag | 0-16 | 1=Flag view enable, 2=Flag Repeat enable, 8=Team display Military, 16= Main Display Player |
13 | My Gun Damage | 0-255 | Mapped |
14 | Mag Size | 0-255 | Raw Value |
15 | Magazines | 0-202 | Raw Value |
16 | Fire Select | 0-2 | 0=semi-auto, 1=Burst, 2=Full Auto |
17 | Burst Size | 0-255 | |
18 | Rounds Min | 0-12 | 0=250, 1= 300, 2=350 ,.., 12=800 |
19 | Reload Delay | 0-255 | default=3 |
20 | IR Power Mode | 0-1 | 0=indoor, 1=outdoor |
21 | Range | 0-6 | 6=max range |
22 | Muzzle Flash | 0-16 | 16=on, 8 = hit Flash, 2 = short range kill?? |
23 | Respawn Health | 0-72 | mapped, 36=100, 72=999 |
24 | Body Armour Min | 1-100 | Minimum damage to penetrate armour |
25 | RESERVED | ||
26 | Body Armour Max | 0-255 | |
27 | Game Mode 1 | 0-255 | Game Mode 1: Zombie Mode ENABLE (+2) Friendly Fire ENABLE (+4) Unlimited Ammo ENABLE (+8) Respawn Flash ENABLE (+16) Flag Flash ENABLE (+32) Game Box RoR ENABLE (+64) Game Box Stay ENABLE (+128) |
28 | Game Mode 2 | 0-255 | Game Mode 2: Body Armour ENABLE (+2) Zombie Flash ENABLE (+4) Near Miss ENABLE (+16) Flag End ENABLE (+32) Ammo RoR ENABLE (+64) |
29 | Hit Delay | 0-255 | Seconds |
30 | Start Delay | 0-255 | respawn delay |
31 | Bleed Out | 0-255 | After being tagged out [killed] you can still be healed during this time |
32 | Game Length | 0-120 | Game time in minutes, 0=No Time Limit |
33 | RESERVED | ||
34 | Zombie Life | 1-72 | (Mapped) 36=100, 58 = 300, 72=999 |
35 | Zombie Damage | 0-16 | (Mapped) 0=1, 13=50, 16=100 |
36 | Body Armour Heal | 0-100 | points/second |
37 | Medic Box Health | 0-100 | Raw value |
38 | Ammo Box Clips | 0-30 | Raw value |
39 | Armour Box Points | 0-100 | Raw value |
40 | Weapon | 0-255 | RoR ENABLE = 0x08, Zombie Sounds = 0x40, Dual Muzzle ENABLE = 0x80 |
41 | RESERVED | ||
42 | Checksum | Checksum calculated for bytes 0-41 |
New Feature

Save the project as LaserTag_C13_Clone
Variables
Add the following variables in the main tab

Edit Game tab
In this tab, the clone tagger operates as its own game state. During this state, the game should be paused, and a signal should be sent when the fire button is pressed. This action triggers the function cloneSendonShoot();
, which is about to be created.

New Function – CloneSendonShoot() – Triggers Tab
At the end of the file, add the following code. This will send the clone signal when the button is pressed by calling the function sendCloneSignal();

New Function – sendCloneSignal() – IR Tab
At the end of the IR tab file, we will include the code for the function sendCloneSignal() along with its dependent function, sendSonyRaw().

void sendCloneSignal(){
milesTagSettingsToArray();
sendSonyRaw(milesTagSetting, sizeof(milesTagSetting) / sizeof(milesTagSetting[0]));
}
void sendSonyRaw(uint8_t* byteArray, size_t arrayLength) {
const uint8_t numBits = 8; // Number of bits in a byte.
const uint16_t startPulse[] = {2400, 600}; // Start Pulse ON & OFF durations.
// Calculate size of rawData: start pulse + (2 durations per bit * numBits * bytes).
uint16_t rawData[2 + (arrayLength * numBits * 2)];
// Add the start pulse.
rawData[0] = startPulse[0]; // ON duration.
rawData[1] = startPulse[1]; // OFF duration.
// Convert byte array to raw data.
uint16_t index = 2; // Start after the start pulse.
for (size_t byteIndex = 0; byteIndex < arrayLength; byteIndex++) {
uint8_t byte = byteArray[byteIndex];
for (uint8_t bitIndex = 0; bitIndex < numBits; bitIndex++) {
if (byte & (1 << bitIndex)) { // Bit is 1.
rawData[index++] = 1200; // ON duration.
rawData[index++] = 600; // OFF duration.
} else { // Bit is 0.
rawData[index++] = 600; // ON duration.
rawData[index++] = 600; // OFF duration.
}
}
}
// data to be sent
Serial.print("Data Sent: ");
for (int i = 0; i < arrayLength*8; i++) {
Serial.print(rawData[i]); // Print each element
Serial.print(" "); // Print a space after each element
}
Serial.println();
// Send the raw data once.
irsend.sendRaw(rawData, index, 40); // 40 kHz frequency.
}
Add Toggle Button
The button should toggle the variable cloneTagger between false and true. When in tagger mode, the button will turn green. Modifications are required in both the MilesTagPage.h and the webActions tab.

<h1>Clone Mode</h1>
<button id="toggleButton" onclick="toggle()">Toggle</button>
<p id="status">State: Loading...</p>
<script>
// Fetch the current cloneTagger state and toggle it on button press
async function toggle() {
const res = await fetch('/toggleAndState');
const state = await res.text();
document.getElementById('status').innerText = "State: " + state;
const button = document.getElementById('toggleButton');
if (state === "true") {
button.style.backgroundColor = "green"; // Change to green
} else {
button.style.backgroundColor = "grey"; // Default color
}
}
// Fetch the current cloneTagger state when the page loads
async function loadState() {
const res = await fetch('/toggleAndState?fetch=true');
const state = await res.text();
document.getElementById('status').innerText = "State: " + state;
const button = document.getElementById('toggleButton');
if (state === "true") {
button.style.backgroundColor = "green"; // Change to green
} else {
button.style.backgroundColor = "grey"; // Default color
}
}
// Call the loadState function when the page loads
window.onload = loadState;
</script>

Test Code
You should now see a small button at the bottom of the “/milestag” webpage

Christian Content
In the precise world of laser tag, the clone signal represents absolute alignment. With one command, Every device instantly adjusts—recalibrating settings, realigning parameters, and synchronising completely. Each tagger becomes perfectly tuned, eliminating any deviation or individual variation in the game settings. However, the clone signal does not change the tagger’s individual identity, such as its name or team; it only alters attributes related to gameplay.
Just as a clone signal transforms scattered devices into a unified system, God seeks to align our hearts with His perfect purpose. Similar to the clone signal, this alignment is not about losing individual identity but about becoming perfectly synchronised with divine intention.
The Bible offers powerful guidance on conforming to God’s will:
Romans 12:2 (NIV)
2 Do not conform to the pattern of this world, but be transformed by the renewing of your mind. Then you will be able to test and approve what God’s will is—his good, pleasing and perfect will.
Romans 8:29 (NIV)
29 For those God foreknew he also predestined to be conformed to the image of his Son, that he might be the firstborn among many brothers and sisters.
As Christians, God is conforming us to be like His Son, Jesus, in order to elevate us to our highest potential. This is a restoration of our lives, freeing us from sin’s distortion and helping us to reflect the perfect love that comes from Him. Just as a laser tag clone signal brings perfect alignment to every device, Christ’s transformative power brings perfect restoration to every human heart.