Laser Fighting Robot

by Rosamking in Circuits > Arduino

5075 Views, 70 Favorites, 0 Comments

Laser Fighting Robot

23.jpg

Hello, Everyone. This is a series of courses, I will share how to use cartons and arduino to make something interesting,today,I'll share with you a laser fighting robot, and I'll show you how to make a robot. By the way,I am very poor standard of English.Hope you will understand me.

Game rules, through the production of two or more battle robots, remote control of the laser head movement, when the laser light to the other side of the photosensitive resistor on the carton, the description was hit, the robot stopped working

You Need to Prepare These Materials

0782067295e45d58bcfb312bd78c60c.png

Circuit Diagram

398bf18195f0227ade60b473e77fd84.png

Assembly

f201346c3c56e3b09f3dc2cf1354d94.png
4.jpg
7.jpg
9.jpg
97b4c9e00cfbd6acdf8c0ebc7999bf1.png
d59e9f9c022b1e9c1d19d4b0f68bf57.png
d25bd345219ec6363684e0c422fb817.png
4e2a66a0f91fd4766fccd2a624438af.png
3f126ed02cd875cc2b26d8f1748aa54.png
c70e490d2edd36dccd3812278f76230.png
19.jpg

In this step, I will show how to build a laser fighting robot. Servo base was use of 3d printing, of course,you can also buy in the Amazon or other web site

Code

#include<Servo.h>

Servo servo_8;

Servo servo_9;

void setup()

{

Serial.begin(9600);

pinMode(13, OUTPUT);

pinMode(2, OUTPUT);

servo_8.attach(8);

servo_9.attach(9);

}

void loop()

{

Serial.println(analogRead(A2));

digitalWrite(13,HIGH);

if (analogRead(A2) > 150) {

digitalWrite(13,LOW);

tone(2,131);

delay(500);

noTone(2);

delay(500);

while(true);

} else {

servo_8.write((map(analogRead(A1), 1, 1023, 1, 180)));

delay(50);

servo_9.write((map(analogRead(A0), 1, 1023, 45, 135)));

delay(50);

}

}

GameRules

798241687608533724.jpg

You need to make two laser fighting robots.Use the joystick to control the movement of the laser head. When the laser irradiates the other side of the photosensitive resistor on the carton of the opposite party,The robot stopped working.