Mini Tank Robot for Arduino Uno

Mini Tank Robot for Arduino Uno

thingiverse

basic arduino code #include <NewPing.h> #include <Servo.h> Servo kol_motor; #define MotorR1 7 #define MotorR2 6 #define MotorL1 9 #define MotorL2 8 #define trigPin 2 #define echoPin 3 #define MAX_DISTANCE 400 NewPing sonar(trigPin, echoPin, MAX_DISTANCE); float duration, distance; void setup() { Serial.begin(9600); pinMode(MotorR1, OUTPUT); pinMode(MotorR2, OUTPUT); pinMode(MotorL1, OUTPUT); pinMode(MotorL2, OUTPUT); kol_motor.attach(9); kol_motor.write(0); } void loop() { distance = sonar.ping_cm(); Serial.println(distance); ileri(); if (distance <10){ geri(); } } void ileri() { digitalWrite(MotorR1, HIGH); digitalWrite(MotorR2, LOW); digitalWrite(MotorL1, HIGH); digitalWrite(MotorL2, LOW); } void geri() { digitalWrite(MotorR1, LOW); digitalWrite(MotorR2, HIGH); digitalWrite(MotorL1, LOW); digitalWrite(MotorL2, HIGH); } void sol() { digitalWrite(MotorR1, HIGH); digitalWrite(MotorR2, LOW); digitalWrite(MotorL1, LOW); digitalWrite(MotorL2, HIGH); } void sag() { digitalWrite(MotorR1, LOW); digitalWrite(MotorR2, HIGH); digitalWrite(MotorL1, HIGH); digitalWrite(MotorL2, LOW); }

Download Model from thingiverse

With this file you will be able to print Mini Tank Robot for Arduino Uno with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Mini Tank Robot for Arduino Uno.