Shop OBEX P1 Docs P2 Docs Learn Events
Pololu micro dual serial motor controller — Parallax Forums

Pololu micro dual serial motor controller

vla7vla7 Posts: 79
edited 2007-12-10 16:29 in BASIC Stamp
Can anyone give some insight into using the the micro dual serial motor controller from Pololu?
The example lego program for the obstacle avoiding robot uses this motor controller and gives the following numbers for controlling 2 motors.· The numbers correspond to the motor number and direction.

left forward···· 0
left back········ 1
right forward··· 2
right back······· 3

When I use the serout command (Serout 6,84,[noparse][[/noparse]$80,0,0,127]) I keep getting both motors spinning instead of only one.

Here's the program I used wanting to get one motor to spin for one second and then stop.

' {$STAMP BS2}
HIGH 6
LOW 5
HIGH 5
PAUSE 100
SEROUT 6,84,[noparse][[/noparse]$80,0,0,127]
PAUSE 1000
SEROUT 6,84, [noparse][[/noparse]$80,0,0,0]
END

Can anyone tell me why both motors are spinning with this command?
·

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-12-10 03:46
    Can you show us what you have connected and where?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • vla7vla7 Posts: 79
    edited 2007-12-10 12:40
    This is how I wired it - see attached
    bmp
    524K
    BS.bmp 524.4K
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-12-10 16:29
    Your problem may be in the way you are resetting your Pololu unit... they recommend that the reset line be brought low for a bit before bringing it high again... try this:

    ' {$STAMP BS2}
    HIGH 6 '<--- you may want to remove this as the SEROUT command will automatically make this pin an output when you execute it a few lines from now.
    LOW 5
    PAUSE 10 '<--- add a pause for 10 ms here to allow the unit to reset before bringing it high again.
    HIGH 5
    PAUSE 100
    SEROUT 6,84,[noparse][[/noparse]$80,0,0,127]
    PAUSE 1000
    SEROUT 6,84, [noparse][[/noparse]$80,0,0,0]
    END


    Have you loaded the test program that Pololu provides in the manual?· Does that work as expected?
Sign In or Register to comment.