hockey1alex
Published

Laser Turret

Check out my youtube channel to see how I did it.

BeginnerFull instructions provided1,977
Laser Turret

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×3
Male/Male Jumper Wires
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Laser Diode, 2 Pins
Laser Diode, 2 Pins
×1

Hand tools and fabrication machines

Tape, Electrical
Tape, Electrical

Story

Read more

Schematics

Arduino and servo.

attach yellow to pin nine with male to male jumper wires. connect black to ground with male to male jumper wires, and connect red to 5 volts using male to male jumper wires. then attach the laser diode to the female side and attach the shorter end to ground. do the same for the next side but attach the pin to 3 volts. then attach the laser to the servo arm using a tack or electrical tape.

Code

CODE

Java
copy the code. and paste it in web editor
#include <Servo.h>

Servo myservo;  
int pos = 0;   
void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}/*

*/

Credits

hockey1alex
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.