Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Android Mobile control Robot Camera using Arduino Uno | Smart Robot
Just Do Electronics
July 19, 2020
Circuit Diagram :-
Video :-
Code And Circuit Diagram :-
Downloads
Code :-
//Prateek //www.prateeks.in #include "AFMotor.h" const int MOTOR_1 = 1; const int MOTOR_2 = 2; const int MOTOR_3 = 3; const int MOTOR_4 = 4; AF_DCMotor motor1(MOTOR_1, MOTOR12_64KHZ); // create motor object, 64KHz pwm AF_DCMotor motor2(MOTOR_2, MOTOR12_64KHZ); // create motor object, 64KHz pwm AF_DCMotor motor3(MOTOR_3, MOTOR12_64KHZ); // create motor object, 64KHz pwm AF_DCMotor motor4(MOTOR_4, MOTOR12_64KHZ); // create motor object, 64KHz pwm int state; int Speed = 130; void setup() { motor1.setSpeed(Speed); // set the motor speed to 0-255 motor2.setSpeed(Speed); motor3.setSpeed(Speed); motor4.setSpeed(Speed); Serial.begin(9600); delay(500); } void loop(){ if(Serial.available() > 0){ //if some date is sent, reads it and saves in state state = Serial.read(); if(state > 10){Speed = state;} } motor1.setSpeed(Speed); // set the motor speed to 0-255 motor2.setSpeed(Speed); motor3.setSpeed(Speed); motor4.setSpeed(Speed); //=============================================================================== // Key Control Command //=============================================================================== if(state == 1){forword(); } // if the state is '1' the DC motor will go forward else if(state == 2){backword();} // if the state is '2' the motor will Reverse else if(state == 3){turnLeft();} // if the state is '3' the motor will turn left else if(state == 4){turnRight();} // if the state is '4' the motor will turn right else if(state == 5){Stop(); } // if the state is '5' the motor will Stop /////////////////////////////////////END\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ delay(80); } void forword(){ motor1.run(FORWARD); // turn it on going forward motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD); } void backword(){ motor1.run(BACKWARD); // the other way motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD); } void turnRight(){ motor1.run(FORWARD); // the other right motor2.run(FORWARD); motor3.run(BACKWARD); motor4.run(BACKWARD); } void turnLeft(){ motor1.run(BACKWARD); // turn it on going left motor2.run(BACKWARD); motor3.run(FORWARD); motor4.run(FORWARD); } void Stop(){ motor1.run(RELEASE); // stopped motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE); }
1 Comments
Unknown
27 September 2021 at 10:43
mast project i like it
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer
Older
ESP32 Interfacing With LDR Sensor
Build Your Own Gps Tracking System using Arduino
IoT Based Fingerprint Biometric Attendance System Using NodeMCU (Esp8266)
Ultrasonic Sensor as a Counter with Arduino
ESP32 Led Blink With Push Button
ESP32 Interfacing Potentiometer
Measure CO2 Level in Air Using Arduino
IoT Based Patient Health Monitoring System Using Blynk App
Vehicle Accident Alert System Using Accelerometer GPS And GSM
Play Audio Sound With Esp8266 With Blink App
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
1 Comments
mast project i like it
ReplyDelete