Thanks i tried and it works. Although i must say that the code had a few extra things which were not needed at all (at-least not in my case) so i made a few modifications to the code and now it works like a charm :) *Thanks Again*
@neilmitra46276 жыл бұрын
Excuse me, if it is possible could you please send me the edited code ( in the comment section here)
@hassanarif1276 жыл бұрын
Well i edited the code for only two motors at first, but later on i added two more motors for which the code provided by makerQ worked perfectly. All i edited in the code was the delay timings, and deleted a while loop, not any other major modification that i can remember, but unfortunately i don't have that code anymore, but if you can tell me the problem you're facing with this code i might be able to help.
@neilmitra46276 жыл бұрын
So the thing that is happening is that my wheels are continuously moving backwards, unable to follow a line, and unable to avoid obstacles, what I did was that I just removed the while loop from the code giving me this: #include //Ultrasonic sensor function library. You must install this library int vSpeed = 110; int turn_speed = 230; // 0 - 255 max int t_p_speed = 125; int stop_distance = 12; int turn_delay = 10; //HC-SR04 Sensor connection const int trigPin = 11; const int echoPin = 12; //L293 Connection const int motorA1 = 3; const int motorA2 = 4; const int motorAspeed = 5; const int motorB1 = 7; const int motorB2 = 8; const int motorBspeed = 6; //Sensor Connection const int left_sensor_pin =9; const int right_sensor_pin =10; int turnspeed; int left_sensor_state; int right_sensor_state; long duration; int distance; void setup() { pinMode(motorA1, OUTPUT); pinMode(motorA2, OUTPUT); pinMode(motorB1, OUTPUT); pinMode(motorB2, OUTPUT); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); Serial.begin(9600); delay(3000); digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2; Serial.print("Distance: "); Serial.println(distance); left_sensor_state = digitalRead(left_sensor_pin); right_sensor_state = digitalRead(right_sensor_pin); if(right_sensor_state == HIGH && left_sensor_state == LOW) { Serial.println("turning right"); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,LOW); digitalWrite(motorB2,HIGH); analogWrite (motorAspeed, vSpeed); analogWrite (motorBspeed, turn_speed); } if(right_sensor_state == LOW && left_sensor_state == HIGH) { Serial.println("turning left"); digitalWrite (motorA1,HIGH); digitalWrite(motorA2,LOW); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); analogWrite (motorAspeed, turn_speed); analogWrite (motorBspeed, vSpeed); delay(turn_delay); } if(right_sensor_state == LOW && left_sensor_state == LOW) { Serial.println("going forward"); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); analogWrite (motorAspeed, vSpeed); analogWrite (motorBspeed, vSpeed); delay(turn_delay); } if(right_sensor_state == HIGH && left_sensor_state == HIGH) { Serial.println("stop"); analogWrite (motorAspeed, 0); analogWrite (motorBspeed, 0); while(true){ } } if(distance < stop_distance) { digitalWrite (motorA1,HIGH); digitalWrite(motorA2,LOW); digitalWrite (motorB1,LOW); digitalWrite(motorB2,HIGH); delay(250); analogWrite (motorAspeed, 0); analogWrite (motorBspeed, 0); delay(500); digitalWrite (motorA1,HIGH); digitalWrite(motorA2,LOW); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); analogWrite (motorAspeed, t_p_speed); analogWrite (motorBspeed, t_p_speed); delay(900); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); analogWrite (motorAspeed, t_p_speed); analogWrite (motorBspeed, t_p_speed); delay(800); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,LOW); digitalWrite(motorB2,HIGH); delay(900); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); delay(700); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,LOW); digitalWrite(motorB2,HIGH); delay(650); digitalWrite (motorA1,LOW); digitalWrite(motorA2,HIGH); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); left_sensor_state == HIGH; while(left_sensor_state == LOW){ left_sensor_state = digitalRead(left_sensor_pin); right_sensor_state = digitalRead(right_sensor_pin); Serial.println("in the first while"); } digitalWrite (motorA1,HIGH); digitalWrite(motorA2,LOW); digitalWrite (motorB1,LOW); digitalWrite(motorB2,HIGH); delay(100); digitalWrite (motorA1,HIGH); digitalWrite(motorA2,LOW); digitalWrite (motorB1,HIGH); digitalWrite(motorB2,LOW); delay (500); } } void loop() { } But what's happening is that the motors/wheels continuously move backwards, unable to do anything else. Please help and thank you for the kind reply!
@MAKERQ6 жыл бұрын
The while loop will stop the car , it is used to stop at the end, if your car is not moving delete that while loop
@vimalabaskar24106 жыл бұрын
MAKER Q I want a coad now pls
@rizalagustian_k23732 жыл бұрын
I'm using arduino uno for this project but the robot won't run at all, you said you have to delete the while loop first but I don't know where the while loop is, please show me 🙏🙏
@MAKERQ6 жыл бұрын
If it's not working delete the while loop in the code and try again
@dhruvpanchal13596 жыл бұрын
Bhai code ka link open kiya to no preview available aa raha h kya karr
@drramkrishnajaiswal91215 жыл бұрын
which is the while loop to be deleted
@relaxingandrefreshingvideo8015 жыл бұрын
bro what is the battery used ?i m using RS.20 9v battery but its not working?
@yadgarqadir58245 жыл бұрын
i have problem with code/.... can you help me
@daniwagaye49306 жыл бұрын
are you sure the code is correct
@Tech_Insights_with_Saha4 жыл бұрын
1:25 Thnx i need this only 💗
@k53_adityakumar65 жыл бұрын
Bhai Tim mast hai love you, are the best man, good luck for your work, thanks for the video, keep it up, nice cool bro.......!!!!!!!!!!!
@nguyenthanhhoan42234 жыл бұрын
Did you do it?
@kidtronics84376 жыл бұрын
love you sir...we went more cool project from you sir..
@k53_adityakumar64 жыл бұрын
Amazing you are mind-blowing
@artiwaghmare8625 жыл бұрын
The code is not appearing... plz send this code.. sr...
@premadwivedi16165 жыл бұрын
What kind of battery I can use instead of 18650 battery plz tell me sir
@abdullahmir75104 жыл бұрын
super, excellent just wow.
@RomsTech5 жыл бұрын
Hello Sir the car is not moving just upload the edited program or plz mail it to me i need it for my ptoject plz reply soon as soon possible i am waiting...........
@nguyenthanhhoan42234 жыл бұрын
you done yet?
@RomsTech4 жыл бұрын
@@nguyenthanhhoan4223 yup lol its been year now
@siddhantindave63915 жыл бұрын
kadak re bhava
@unitedrobotics73774 жыл бұрын
Is the output of the ir sensor is low or high?? Please answer..
@latachavan90133 жыл бұрын
Arduino nano programing not open in to the description please give me the programing
@smtechnomind49494 жыл бұрын
sir kya hum iss project me arduino uno use kr sakte hai kya with l298n and isake connection kaise rahenge with arduino uno.
@maartengevers78006 жыл бұрын
can you plz send the code i need to make some thing similar for school and it whould help a lot thank u
@1man4tech476 жыл бұрын
Can you provide for l298d with program . I was typing to change your program but I cannot make.
@bharathkumarreddy16356 жыл бұрын
my motors are not moving.please help me
@rizalagustian_k23732 жыл бұрын
I'm using arduino uno for this project but the robot won't run at all, you said you have to delete the while loop first but I don't know where the while loop is, please show me 🙏🙏
@sankalpjadhav41475 жыл бұрын
Can you plz share the list of all components required for this whole project and even the program we have a project based on this! Please sir
@parthaprateempatra42786 жыл бұрын
Very well made
@mohammednisthar76594 жыл бұрын
Can you explain me what to do when only the obstacle avoidance works and the line follower doesn't works
@relaxingandrefreshingvideo8015 жыл бұрын
bro motos are not rotating???
@vishalshukla53634 жыл бұрын
can you let me know if it drives in revers after completing the line in to point b and ten it comes back to point a in a line with obstacles.
@bahaaeldin26564 жыл бұрын
can it be made with python? i have been trying for 2 days to recreate it with python and rpi but no luck
@eswarchandu21224 жыл бұрын
is it work with power bank?
@bimalxaviour84646 жыл бұрын
Which battteries do you use
@JahangirAlam-gs6uq5 жыл бұрын
Can i use arduino uno?
@joeycerafice78435 жыл бұрын
any idea how to fix a problem where only the front left and back left wheels are working.
@shalinimondal7795 жыл бұрын
Please tell while loop wala portion kitna tak delete karna hoga please
@deepakbains67555 жыл бұрын
sir i want to make all in one .bluetooth controlled +line following + obstacle avoidance ..please help in code or make a video of all in one ..
@TheDutchGamingBE5 жыл бұрын
You just have to buy a bluetooth module, connect it to the arduino, compile a bluetooth app to control the car. After all that, compile a code for the arduino so that the bluetooth module on the car can give orders to the arduino board that controls the car
@marshrodrigues81165 жыл бұрын
can i erase the old program of line following and use this new given program
@ravishankarshetty25834 жыл бұрын
Can we use arduino uno instead of arduino nano
@akhil_aryanad4 жыл бұрын
Superrr
@thrillsconnect24946 жыл бұрын
Will the cose work with ardiuno uno
@dimplebhootra47305 жыл бұрын
Is it the same with arduino uno
@vantakulasairam54015 жыл бұрын
hello! I made it. but, It's not following line and also not detecting obstacles. just moving in different directions. can you please help me!
@nguyenthanhhoan42234 жыл бұрын
you done yet?
@ayaismeal46473 жыл бұрын
do you have the same code using raspberry ?
@ayshashanza85063 жыл бұрын
Wau 😍😍😍
@raghavnaikdessai65775 жыл бұрын
Can we use arudino uno insted of arudino nano
@relaxingandrefreshingvideo8015 жыл бұрын
reply brooooooooooo if obstacle is there again after turning left, what to do?
@huythang34786 жыл бұрын
can it work with arduino uno r3?
@bimalxaviour84646 жыл бұрын
Thắng Huy Yes
@nguyenthanhhoan42234 жыл бұрын
xe chạy được chưa bro ơi.
@piyushv57396 жыл бұрын
Plzz tell if it is working so I can make my science model
@ramubj1652Ай бұрын
Where we want to delete while loop in the code
@muhammadmehedihasanshishir90176 жыл бұрын
Can it work with 9V battery and using 2 motors?
@achrafnatouss46225 жыл бұрын
if you have code correct pls help me belkadirac@gmail.com
@hasithasandeepa6046 жыл бұрын
Sir...,How I can use Pid Control for this car...?
@chaitanyachavan72786 жыл бұрын
Please make same project using Arduino Uno
@zalriego29810 ай бұрын
This the code updated?
@tejasoke6555 жыл бұрын
Can we use Arduino Uno instead of nano
@mohammedjubaed9685 жыл бұрын
Maker Q help me when i clicked the link of code it shows (No preview available)what can i do now???
@vantakulasairam54015 жыл бұрын
DOWNLOAD it.
@TRAVELLER_DEV5 жыл бұрын
Sir i am student and making line following many error is occuring please help
@ShubhamGupta-bs5rh5 жыл бұрын
In place of Arduino Uno can I use Arduino nano
@mobilehelp42084 жыл бұрын
What weight bear this car
@r0ckstar6 жыл бұрын
Can i use a 12v battery
@1man4tech476 жыл бұрын
Sir you battery is of how much voltage
@MAKERQ6 жыл бұрын
+1 MAN 4 TECH 7.4v
@saumtallyshahanahwardah82796 жыл бұрын
Am using a L293D is it a problem and am having a problem the robot look like its about to move but stop , can u help me
@MAKERQ6 жыл бұрын
Have you removed the while loop from the code?
@saumtallyshahanahwardah82796 жыл бұрын
Yess sir but it is not moving at all, can you send me you email address so that i can send you my codes and tell me what am doing wrong .
@1man4tech476 жыл бұрын
bro how you have taken motor connections in program
@MAKERQ6 жыл бұрын
What you mean?
@muhaiminulhaquepiyas74284 жыл бұрын
sir your attachment code is not open .Why?plz help me
@harishtwo525 жыл бұрын
If I use arduino UNO instead of arduino nano then can I use the same codes or different codes are needed?
@culturarobotica60525 жыл бұрын
you have no problem you can use any arduino
@nguyenthanhhoan42234 жыл бұрын
you done yet?
@sab_tech6 жыл бұрын
hi MAKER Q i'm using adafruit motor shield can you give me the program for that plsplspslspls i have school exhibition
@divyanshsao93804 жыл бұрын
Sir I want to stop the robot when there is obstacles how to do that , please share another code for that please please please 🙏
@divyanshsao93804 жыл бұрын
Please share this code without rotating it
@youdisteve29186 жыл бұрын
what is the type of arduino you used in this car?
@MAKERQ6 жыл бұрын
Yudhi Ardian Arduino nano
@tanishtated19265 жыл бұрын
what we can write in behalf of c/cc+ which is written in code
@Durgesh_OeM5 жыл бұрын
While compiling code through mobile application ArduinoDroid it says error What should I do
@TheDutchGamingBE5 жыл бұрын
Maybe the library in which you're compiling the code ?
@shakirmppnd54013 жыл бұрын
How many total expensive bro
@latachavan90133 жыл бұрын
Sir please give me the Arduino nano programing
@ghatkarinagesh61732 жыл бұрын
Is their any code to do this
@samkitjain1486 жыл бұрын
the code is unspportive....what should I do?
@abhisheksahoo92293 жыл бұрын
Sir can I use Arduino Uno
@fazalmohammad61766 жыл бұрын
Where we have to write 'if' in the delay to come to line?
@sugumarvelu20792 жыл бұрын
Sir what is the rpm of the motor
@dodoashraf40146 жыл бұрын
The code is not appearing Can you send me the code,please?
@67omkarwaghmare285 жыл бұрын
Coding link is not working please make again.
@aneesh20925 жыл бұрын
Can I know the circuit diagram with pro mini aurdino
@dhaneshbaheti5 жыл бұрын
Nice
@1man4tech476 жыл бұрын
I have used this code in my UNO and with same pining but the modal is not working
@owaiskhan40986 жыл бұрын
same problm
@shivaprasadj30306 жыл бұрын
owais khan hello did u get solution???
@itzmeathul78363 жыл бұрын
Bro ith malayalathil oru vdo cheyyoo plzzzzx
@jabedomor8875 жыл бұрын
the code is error....why?? expected initializer void
@Secret.words.p3 жыл бұрын
U dont have Instagram?
@madhusudandash28596 жыл бұрын
sir,i am a student .I have attempt to make a line following and abstacle avoding Robot according to this video. I corectly connect all wires according to your circuit diagram and upload your codes to my arduino nano. but the Robot is not movving.why? reply me.pls pls pls pls.
@MAKERQ6 жыл бұрын
Madhusudan Dash delete the while loop in the code
@MAKERQ6 жыл бұрын
And try it
@nguyenthanhhoan42234 жыл бұрын
you done yet?
@nguyenthanhhoan42234 жыл бұрын
i'm a student. i need help too :)) please !
@arjunajee51674 жыл бұрын
How can i get the items
@prasannalaxmi12495 жыл бұрын
Can you do with arduino uno plrase
@1man4tech476 жыл бұрын
I mean that can we use l298d instead of l298n
@MAKERQ6 жыл бұрын
L298D OR L293D?
@1man4tech476 жыл бұрын
L298d
@jibinsaju15 жыл бұрын
1 MAN 4 TECH Bro..will this project actually work ?
@AbelJiss17 күн бұрын
What is program program link
@shivanshbansal73886 жыл бұрын
can i use arduino uno instead of nano
@r0ckstar6 жыл бұрын
yes
@maddukuridurgaprasad19506 жыл бұрын
Can we add Bluetooth to it then send to me circuit diagrams please send me the code
@prasannalaxmi12495 жыл бұрын
Can you please make the robot with arduino uno
@TRAVELLER_DEV5 жыл бұрын
Sir error occurred Of problem uploding to board
@dasunsathra13355 жыл бұрын
this robo is very easy made
@gamingwithsimba35634 жыл бұрын
Nice brain
@saifkhld4 жыл бұрын
how can i get the code
@adithya35544 жыл бұрын
🤩🤩🤩
@shekhartandel45474 жыл бұрын
Can you pls send me the code for only two motors pls
@jasonflores87345 жыл бұрын
what are materials for this project? need asap
@manugowda38455 жыл бұрын
Can we apply program in mobile?
@vantakulasairam54015 жыл бұрын
cannot
@sahil.dzimal74114 жыл бұрын
it's not working please help me.
@maddukuridurgaprasad19506 жыл бұрын
I did it but motor is not running,what is the folt
@vantakulasairam54015 жыл бұрын
i too did it, motors running, but not following line