Shop OBEX P1 Docs P2 Docs Learn Events
Controlling a Serial Dual H Bridge Board with the Stamp — Parallax Forums

Controlling a Serial Dual H Bridge Board with the Stamp

RobomasterRobomaster Posts: 8
edited 2009-04-21 16:12 in BASIC Stamp
I have a Serial Dual H Bridge Board Kit that I put together and I am using a Basic Stamp-2 to control it. I have one program that works. It uses preset values and delays to control motors and I got one that ramps them up and down in speed.
·
What I am trying to write is one where that I type in the motor the motor control values Motor number, Speed, Direction, and tell it to run .
·
I have attached the code I have been working on. I help in getting it working and I can’t see what’s wrong.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tim J Lewis

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-04-21 03:00
    I guess my first question would be what is it doing and not doing? In other words, why do you think it is wrong?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • RobomasterRobomaster Posts: 8
    edited 2009-04-21 15:28
    What is happing it is taking the data in but when I tell it to make the motors run it just sit there and motors do not move. I going to attach the manuals for each of the boards. Thank You for your help. ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tim J Lewis
  • JDJD Posts: 570
    edited 2009-04-21 16:12
    Robomaster,

    It looks like when you are watching for the DEBUGIN Direction it's waiting for a value of 1 or 2. The ASCII value for the number 1 is 49 and 2 is 50. Try changing the IF... THEN statements with the following.

    IF Direction = 49 THEN DIRRA =0
    IF Direction = 50 THEN DIRRA = 32

    Please let me know if this works.

    Just a suggestion, you might want to implement a "valid entry" portion to the program, so you can't get erroneous data.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
Sign In or Register to comment.