# Proffieboard Laser Tag

**URL:** <https://crucible.hubbe.net/t/proffieboard-laser-tag/2815>\
**Category:** Proffieboards\
**Tags:** idea\
**Created:** [January 12, 2023, 6:30pm UTC](https://crucible.hubbe.net/t/proffieboard-laser-tag/2815 "2023-01-12T18:30:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChickenTendy](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/c/ac91a4/32.png) [@ChickenTendy](https://crucible.hubbe.net/u/ChickenTendy)\
**Post date:** [January 12, 2023, 6:30pm UTC](https://crucible.hubbe.net/t/proffieboard-laser-tag/2815/1 "2023-01-12T18:30:53Z")

</div>

Working on a somewhat unique project I could use a second pair of eyes on… Long story short, I’m 3d printing Blasters to use as laser tag guns with Proffie steroids.

I developed a Proffie config for use as the laser tag controller and reciever. But could use some guidence from the Proffie experts.

MTFBWY

```auto
// Gun config for laser tag

// Pin Definitions
#define PRIMARY_BUTTON_PIN 2 // Pin for primary button
#define OVERHEAT_BUTTON_PIN 3 // Pin for overheat button
#define LASER_PIN 9 // Pin for IR laser
#define LED_PIN 10 // Pin for high power LED

// Sound bank settings
#define NUM_BANKS 1
const uint8_t bank1_pins[] = {11}; // Sound effect pin
const uint8_t bank1_varnums[] = {1}; // Sound effect variable

// Sound Effects
const uint16_t sound_fire[] = {100, 880, 100, 880};

// Variables
uint8_t overheat_count; // Tracks number of shots fired
uint8_t overheat_max; // Maximum number of shots before overheat
bool is_overheated; // Whether the gun is currently overheated
unsigned long overheat_start; // Time when overheat starts
unsigned long overheat_duration; // How long overheat lasts

// Set up function
void setup() {
  // Set initial values for overheat variables
  overheat_count = 0;
  overheat_max = 10;
  overheat_start = 0;
  overheat_duration = 3000;
  is_overheated = false;
  
  // Set button pins as inputs
  pinMode(PRIMARY_BUTTON_PIN, INPUT);
  pinMode(OVERHEAT_BUTTON_PIN, INPUT);
  
  // Set laser and LED pins as outputs
  pinMode(LASER_PIN, OUTPUT);
  pinMode(LED_PIN, OUTPUT);
}

// Loop function
void loop() {
  // Check if primary button is pressed
  if (digitalRead(PRIMARY_BUTTON_PIN) == LOW) {
    // Check if gun is not overheated
    if (!is_overheated) {
      // Fire laser and LED
      digitalWrite(LASER_PIN, HIGH);
      digitalWrite(LED_PIN, HIGH);
      
      // Play fire sound effect
      play_sound(1, bank1_pins, bank1_varnums);
      
      // Increment overheat count
      overheat_count++;
      
      // Check if overheat count is at maximum
      if (overheat_count >= overheat_max) {
        // Set overheat start time
        overheat_start = millis();
        // Set is_overheated to true
        is_overheated = true;
      }
    }
    // Wait for button to be released
    while(digitalRead(PRIMARY_BUTTON_PIN) == LOW);
  }
  else {
    // Turn off laser and LED
    digitalWrite(LASER_PIN, LOW);
    digitalWrite(LED_PIN, LOW);
  }
  
  // Check if overheat button is pressed
  if (digitalRead(OVERHEAT_BUTTON_PIN

```

```auto
// Receiver config for laser tag

// Number of sound banks
#define NUM_BANKS 1

// Sound bank settings
const uint8_t bank1_pins[] = {11}; // LED pin
const uint8_t bank1_varnums[] = {1}; // LED pattern variable

// LED patterns
const uint32_t pattern_hit[] = {CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green};
const uint32_t pattern_no_hit[] = {CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black};

// Variables
uint8_t hit_count;

// Set up function
void setup() {
  // Set initial value of hit_count to 0
  hit_count = 0;
}

// Loop function
void loop() {
  // Check if IR signal is received
  if (irrecv.decode(&results)) {
    // Increment hit_count
    hit_count++;
    // Display hit pattern on LED
    set_pattern(1, pattern_hit, sizeof(pattern_hit));
    // Play sound effect
    play_sound(1, bank1_pins, bank1_varnums);
    delay(1000); // Wait for 1 second
  }
  else {
    // Display no hit pattern on LED
    set_pattern(1, pattern_no_hit, sizeof(pattern_no_hit));
  }
  irrecv.resume(); // Receive the next value
}

```

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [January 12, 2023, 8:07pm UTC](https://crucible.hubbe.net/t/proffieboard-laser-tag/2815/2 "2023-01-12T20:07:18Z")

</div>

You’d probably be better off doing this as a ProffieOS prop.  
ProffieOS can play sound for you, decode incoming IR and also send outgoing encoded IR.  
There is also pre-made code for encoding/decoding signals from some toy laser tag guns here:

> <https://github.com/profezzorn/ProffieOS/blob/6b5abe2bc789237c05c3df63aab7245c15c27b7f/ir/blaster.h>

There is no library available for Proffieboards to make it easy to play sounds outside of ProffieOS unfortunately.

---

<div class="post-metadata">

**Author:** ![ChickenTendy](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/c/ac91a4/32.png) [@ChickenTendy](https://crucible.hubbe.net/u/ChickenTendy)\
**Post date:** [January 12, 2023, 8:39pm UTC](https://crucible.hubbe.net/t/proffieboard-laser-tag/2815/3 "2023-01-12T20:39:07Z")

</div>

I didn’t even know that Proffie Laser tag had already been thought up! Neat!

I’ll take a look at this prop, thanks, Fredrick!

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [January 12, 2023, 9:38pm UTC](https://crucible.hubbe.net/t/proffieboard-laser-tag/2815/4 "2023-01-12T21:38:20Z")

</div>

Well, I was mostly investigate these laser tag guns as a way to implement laser deflect for light sabers.

[![](https://img.youtube.com/vi/mTqKa9CKwYM/maxresdefault.jpg "Proffie IR demo") ](https://www.youtube.com/watch?v=mTqKa9CKwYM)

---

<div class="post-metadata">

**Author:** ![M750](https://crucible.hubbe.net/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@M750](https://crucible.hubbe.net/u/M750)\
**Post date:** [January 20, 2023, 6:07am UTC](https://crucible.hubbe.net/t/proffieboard-laser-tag/2815/5 "2023-01-20T06:07:32Z")

</div>

Well shit, that’s the coolest thing I’ve seen all day!
