Arduino Laser Tag - After playing LaserTag for the first time, my 9 year old son wanted to make one to play with his friends at home.
After playing LaserTag for the first time, my 9 year old son wanted to make one to play with his friends at home.
My son and I came up with ideas on how it should work:
There should be two teams, green and yellow (any color works.. as well as number of teams)
Lasers should recharge quickly, but not instantly.
If you get hit, you loose ability to shoot for a given time.
You have a set health that rebuilds with time... each shot takes away from your health.
We are using IR LEDS from remote controls and IR Sensors attached to arduino. This way, each team will shoot their own "laser bullet" with a unique remote code. You are "shielded" from your own laser and those of your teams.
To do this, you need to check the code of the shooter and see if it belongs to your team... if not, then a hit is scored.
Hardware Needed for each gun:
arduino
piezo buzzer
IR LED Emitter
IR Receiver
1 RGB LED to indicate health/team
1 pager motor
5 LEDS to indicate charge/firing condition
tactile switch for trigger
rotary switch for team selection
items that we might add on:
lcd screen to give point/health readouts
two way communication between arduinos to share score/health information, possibly with IR blaster to send info out 360 degrees
Procedures:
check team from rotary switch position
-> set RGB to team color
-> set home IR code
check IR receiver
-> if hit, check to see if own team,
-> if on own team blink RGB led
->if not
->indicate a hit with
pager motor,
piezo speaker and
RGB light (using color of team who hit you),
->drop health by one,
->drain power from gun
-> if health =0,
->power down gun for set time period
check trigger
-> if activated,
check gun power
-> if full power,
allow shot to be taken,
indicate firing with
piezo speaker and
LED lights on gun,
drain power completely,
->if not full power, drain power by one
Embed This Sketch
Use the following HTML code to embed the sketch code above in your blog or website.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:368965" frameborder="0"></iframe>
Embed The Serial Monitor
You can also embed the Serial Monitor section! Just use this HTML code.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>