Page 1 of 1

problem with changing motor direction

PostPosted: Thu May 29, 2014 12:09 am
by yasir904
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

Re: problem with changing motor direction

PostPosted: Thu May 29, 2014 2:59 pm
by sich
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.