Go Down

Topic: V Visitor Laser Gun Replica Prop with Light and Sound (Read 6 times) previous topic - next topic

the-rebel-agent

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

http://www.youtube.com/watch?v=0rdIbUhGxCI

the-rebel-agent

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

http://www.youtube.com/watch?v=IpUpi0OmHHI

Code: [Select]
/*
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.

the-rebel-agent

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

http://www.youtube.com/watch?v=_RGRAhex7Zs

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





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

onesky


the-rebel-agent

Thanks, you stared all this Arduino fever on me

Go Up