Pages: [1]   Go Down
Author Topic: Arduino-controlled Nerf Pulse Rifle  (Read 2112 times)
0 Members and 1 Guest are viewing this topic.
Tallahassee, Florida, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Me being afraid of failure is like a fish being afraid of water.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is my first project using the Arduino. It's been a lot of fun and I wanted to share my experience.

The rifle is part of a "Space Marine" Halloween costume. To avoid being shot by the police, I figured some pulsating LEDs down the inside of the barrel would look pretty cool and hopefully make it safe... These are just some pictures and links of the little project:

This is a 'making of' video:
http://youtu.be/Ci9YRVWrUfI

And this is a short 'finished project' video:
http://youtu.be/9y6BOcJV0uE



* 3PulseRifle.jpg (223.68 KB, 811x606 - viewed 89 times.)

* 7ArduinoMagazine2.png (804.26 KB, 1082x717 - viewed 60 times.)

* 8ArduinoLEDs4.jpg (159.57 KB, 1211x679 - viewed 50 times.)

* 12PulseRifle.jpg (39.49 KB, 595x321 - viewed 52 times.)
Logged

I don't know. Plug it in and see what happens...

Tallahassee, Florida, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Me being afraid of failure is like a fish being afraid of water.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, this is the sketch code that makes the in and out fade:


Quote
int value;
int ledpin = 3;                        // light connected to digital pin 3
int ledpin2 = 6;                         //light connected to digital pin 6
 int ledpin3 = 9;                           // light connected to digital pin 9
int ledpin4 = 11;                           // light connected to digital pin 11
 long x=1;
void setup()
{
  // nothing for setup
}
void loop()
 {   
  value = 128+127*sin(x*0.0174532925);   //Degrees to radians
  analogWrite(ledpin, value);            // sets the value (range from 0 to 255)
   analogWrite(ledpin2, value);           // sets the value (range from 0 to 255)
  analogWrite(ledpin3, value);           // sets the value (range from 0 to 255)
   analogWrite(ledpin4, value);           // sets the value (range from 0 to 255)
  if (x==360)
  {
    x==0;
  }
  delay(100);
   x += 1;
}

Logged

I don't know. Plug it in and see what happens...

Pages: [1]   Go Up
Jump to: