Pages: 1 [2]   Go Down
Author Topic: V Visitor Laser Gun Replica Prop with Light and Sound  (Read 6383 times)
0 Members and 1 Guest are viewing this topic.
Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Connected the audio module to an amplifier. Sounds really loud.

Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

New version of the software + a fire module selection option. Regular and Stun laser gun. Everything working at 5V.



Code:
/*
 Sketch to control a V Visitor laser gun prop.
 Created by Diego J. Arevalo, November 26, 2012.
 Released into the public domain.
 */

#include <Wtv020sd16p.h>
#include <Pam8803.h>
#include "LaserGunFactory.h"

const int WTV_RESET_PIN = 2;
const int WTV_CLOCK_PIN = 3;
const int WTV_DATA_PIN = 4;
const int WTV_BUSY_PIN = 5;
const int ANALOG_LED_PIN= 6;
const int TRIGGER_PIN = 7;
const int FIRE_MODE_PIN = 11;
const LaserGunType LASER_GUN_TYPE = VVisitorLaserGun;
const int AMP_VOLUME_DOWN_PIN = 8;
const int AMP_VOLUME_UP_PIN = 9;
const int AMP_RESET_PIN = 10;

static Pam8803 *pam8803 = NULL;
static LaserGun *laserGun = NULL;
static LaserGunFactoryParameters laserGunFactoryParameters;

void setup() {
  pam8803 = new Pam8803(AMP_RESET_PIN, AMP_VOLUME_UP_PIN, AMP_VOLUME_DOWN_PIN);
  pam8803 -> reset();
  pam8803 -> setVolume(50);
  laserGunFactoryParameters.setWtvResetPin(WTV_RESET_PIN);
  laserGunFactoryParameters.setWtvClockPin(WTV_CLOCK_PIN);
  laserGunFactoryParameters.setWtvDataPin(WTV_DATA_PIN);
  laserGunFactoryParameters.setWtvBusyPin(WTV_BUSY_PIN);
  laserGunFactoryParameters.setAnalogLedPin(ANALOG_LED_PIN);
  laserGunFactoryParameters.setTriggerPin(TRIGGER_PIN);
  laserGunFactoryParameters.setFireModePin(FIRE_MODE_PIN);
  laserGunFactoryParameters.setLaserGunType(LASER_GUN_TYPE);
  laserGun = LaserGunFactory::getLaserGun(laserGunFactoryParameters);
}

void loop() {
  laserGun -> senseSwitches();
}

Attached the whole Sketch in this post. Enjoy.

* LaserGunSketch.zip (11.61 KB - downloaded 41 times.)
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And everything working at 3.3v with a new Arduino Mini Pro 8Mhz.



By the way, the laser gun was 3D printed last week:





I am about to finish this project in about 3 months.
Logged

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 153
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

great!
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, you stared all this Arduino fever on me
Logged

Pages: 1 [2]   Go Up
Jump to: