Controlling a Serial Dual H Bridge Board with the Stamp
Robomaster
Posts: 8
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
·
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tim J Lewis
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