MisterBotBreak
Published

How to Make a Laser Turret for Your Cat

This project will show you how to make a laser turret.

BeginnerFull instructions provided12 minutes24,107
How to Make a Laser Turret for Your Cat

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Analog joystick (Generic)
×1
Laser
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

laser_turret_14Q5LdcxQp.fzz

Code

Code Laser turret

Arduino
#include <Servo.h>

Servo myservo ;
Servo my2ndservo;

void setup()
{
 Serial.begin(9600);
 myservo.attach(9);
 my2ndservo.attach(3);
 pinMode(13,OUTPUT);
}
 
void loop()
{
 digitalWrite(13,1);
 
 delay(20);                    
 
 int XVal = analogRead(A1) ;  
 myservo.write((XVal/7.7));
 Serial.println(XVal);
 
 int YVal = analogRead(A0) ;  
 my2ndservo.write((YVal/5.7));        
 Serial.println(YVal);
}

Credits

MisterBotBreak

MisterBotBreak

48 projects • 151 followers
I love electronics and cats :D !

Comments