problem with changing motor direction

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

problem with changing motor direction

Postby yasir904 » Thu May 29, 2014 12:09 am

Hi guys.
I'm new to this Arduino thing. I have a uni project that I am working on which is to control arduino robot from PC through USB. I am trying to control the robot with the software Scratch 4 Arduino(S4A).

My hardware setup currently is just arduino UNO with an arduino 2A motor shield (L298) connected to tamiya gearbox which holds 2 DC motors all bought from Cytron. What I am having now is I can play around with the values on pin 5 and 6 and it worked well (ie speed changes). However, I not able to change the direction of the motor (pin 4 and 7)even though I tried changing it in S4A. Both motors spin counterclockwise which make the robot spin one direction forever. Is there something wrong with my S4A sketch (ie. anything I should add/drop)? Can someone out here whose familiar with S4A help me? Or maybe offer other wired-solution than using S4A? right now wireless is not an option for me.
Thanks
Yasir
Attachments
movement.png
yasir904
Fledgling
 
Posts: 1
Joined: Wed May 28, 2014 11:55 pm

Re: problem with changing motor direction

Postby sich » Thu May 29, 2014 2:59 pm

Your logic looks okay to me. Could it be hardware setup or connection problem? I saw "Searching board..." message at the top right corner.

Now all 4 conditions run the motors at full speed. Can you alter the speed of your motors? Then you will know whether that specific segment of code is executed. Of course you can show changes using Sprite or light up the LED on Arduino too.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 22 guests