Thank You It was Very Helpful
No problem, glad that you were able to use it successfully... you've now made it easier for people to help you!
From your last video, judging by the frequency of the driver lights, it's possible that the PWM frequency is too low for the motor to support that speed?
Actually It only happens when the arduino is being powered by the usb port but when i supply the arduino from the driver's 5V it self it Runs Smoothly.
Actually It only happens when the arduino is being powered by the usb port but when i supply the arduino from the driver's 5V it self it Runs Smoothly.
Then perhaps the USB cannot supply sufficient enough power, and that is the problem?
const int xDirPin(A0); const int yDirPin(A1); void setup() { Serial.begin(9600); } void loop() { if((analogRead(xDirPin) < 480) or (analogRead(xDirPin) > 520)) { Serial.print("X: "); // Stop the motor inside this statement Serial.println(analogRead(xDirPin)); } if((analogRead(yDirPin) < 480) or (analogRead(yDirPin) > 520)) { Serial.print("Y: "); // Stop the motor inside this statement Serial.println(analogRead(yDirPin)); } delay(50); }
I think the Joystick Shield is working Fine. I tried and these are the results:-
It looks like your results show that it is still running when you let go of the joystick?
In my case, the code does not run (i.e: the X and Y values stop printing), unless I move the joystick... that was the whole point of the test to check if the joystick is operating as expected.
The code you showed above was just missing the Serial.begin(baudrate); in void setup()
Make sure you select the same baud rate in your serial monitor (if possible a rather high one like 57600 or 115200), and add some kind of method to avoid printing in each end every loop like i showed, oherwise the output will be overwhelming
Eric
Would this topic be better in the 'Help wanted' section? It just goes on and on...
It looks like your results show that it is still running when you let go of the joystick?
In my case, the code does not run (i.e: the X and Y values stop printing), unless I move the joystick... that was the whole point of the test to check if the joystick is operating as expected.
So That means my Joystick shield is not Properly. Guess I have to move on to the single joystick module.
Would this topic be better in the 'Help wanted' section? It just goes on and on...
What is this Section or Where is it ?
In my case, the code does not run (i.e: the X and Y values stop printing), unless I move the joystick...
but in many code examples i have seen that for testing the joystick modules the the serial monitor continoues to show some values while the joystick shield is free. take a look in this video:-
please try this code for once with your module and share your results. I will try to do the same.
No no no, the code I wrote is to test whether your joystick isn't behaving as expected (for example, when you let it go... it no longer produces values (because it's in the dead zone) and nothing more.
Your question for help was: "Robot Car Continously Running Why ?"
If your joystick does continue to run under the code example I presented (even after you tweaked the range values as I mentioned), then your joystick is not behaving like mine, and you need to decide if the operation of your joystick is acceptable to you or not, and adjust your algorithm accordingly, or purchase a new one if you believe this test proves it's faulty.