LOGIN
Mujadid Ali
1
Apprentice
Student
Share
Report
Get Link
STATUS

My Working..

#include<SoftwareSerial.h>


int MotorR1 = 5;
int MotorR2 = 6;
int MotorL3 = 7;
int MotorL4 = 8;
int MotorRENA = 9;
int MotorLENB = 10;
int Time = 450;
int Speed = 150;

char Command ;


void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);


  pinMode(MotorR1, OUTPUT);
  pinMode(MotorR2, OUTPUT);
  pinMode(MotorL3, OUTPUT);
  pinMode(MotorL4, OUTPUT);
  pinMode(MotorRENA, OUTPUT);
  pinMode(MotorLENB, OUTPUT);
 

}

void loop() {
  // put your main code here, to run repeatedly:

  //Setting the motors speeds
  analogWrite(MotorRENA, Speed);
  analogWrite(MotorLENB, Speed);



 

  if(Serial.available())
  {
    Command = Serial.read();

   Serial.println("The Received Command");
   Serial.println(Command); 
  }

  if(Command == '1')
  {
    Serial.println("Enter in forward");
    digitalWrite(MotorR1, HIGH);
    digitalWrite(MotorL3, HIGH);
    delay(Time);
    digitalWrite(MotorR1, LOW);
    digitalWrite(MotorL3, LOW);
    Serial.println("Exit From forward");
  }else if(Command == '2')
  {
    digitalWrite(MotorR2, HIGH);
    digitalWrite(MotorL4, HIGH);
    delay(Time);
    digitalWrite(MotorR2, LOW);
    digitalWrite(MotorL4, LOW);
  }else if(Command == '3')
  {
    digitalWrite(MotorR1, HIGH);
    delay(Time);
    digitalWrite(MotorR1, LOW);
  }else if(Command == '4')
  {
    digitalWrite(MotorL3, HIGH);
    delay(Time);
    digitalWrite(MotorL3, LOW);
  }else if(Command == '5');
  {
    digitalWrite(MotorR1, LOW);
    digitalWrite(MotorL3, LOW);
    digitalWrite(MotorR2, LOW);
    digitalWrite(MotorL4, LOW);
  }

  delay(1000);

}
Contributions
Mujadid Ali

Gave a new working code 👏👌👏

4 likes 
Like
Award Contribution
Steven Reubenstone
39
Community Expert
Mechanical Engineer & Tinkerer of Things.
 · New YorkU.S.
Share
Report
Get Link

great

Like
1 like 
Award Contribution
Ekhtiak Efat
5
Collaborator
Student (Project Leader)
 · PabnaBangladesh
Share
Report
Get Link

Very good work :)

Like
1 like 
Award Contribution
Ekhtiak Efat
5
Collaborator
Student (Project Leader)
 · PabnaBangladesh
Share
Report
Get Link

there is a little error in the code, in if 1 loop there is extra */. remove it please Mujadid Ali

Like
1 like 
Award Contribution
Mujadid Ali
1
Apprentice
Student
Share
Report
Get Link

Thanx for identifying the mistake … because i am working on code and adding more sensors, that’s the reason…

Like
1 like 
Award Contribution
Mechanical Engineer
 · MumbaiIndia
Share
Report
Get Link

i already had made voice controlled robot , you can check it on youtube -https://youtu.be/Ff0poI3Qh_o
if you stuck somewhere in coding or no response from arduino then you can messege me i’ll surely help you.

Like
0 like 
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link