??? 02/12/07 19:18 Modified: 02/12/07 19:22 Read: times |
#132656 - One more problem - Direction Responding to: ???'s previous message |
Sorry to bring this back from the dead but I'm having one small problem.
How do I make it go the opposite direction? I've tried just sending the values to the output in the reverse order but it doesn't work. I've had to write a second table of values reversing A and B. Is there a better way to do this? static code char forward[] = { A_PLUS | A_100 | B_PLUS | B_0, A_PLUS | A_67 | B_PLUS | B_67, A_MINUS | A_0 | B_PLUS | B_100, A_MINUS | A_67 | B_PLUS | B_67, A_MINUS | A_100 | B_MINUS | B_0, A_MINUS | A_67 | B_MINUS | B_67, A_PLUS | A_0 | B_MINUS | B_100, A_PLUS | A_67 | B_MINUS | B_67 }; static code char reverse[] = { B_PLUS | B_100 | A_PLUS | A_0, B_PLUS | B_67 | A_PLUS | A_67, B_MINUS | B_0 | A_PLUS | A_100, B_MINUS | B_67 | A_PLUS | A_67, B_MINUS | B_100 | A_MINUS | A_0, B_MINUS | B_67 | A_MINUS | A_67, B_PLUS | B_0 | A_MINUS | A_100, B_PLUS | B_67 | A_MINUS | A_67 }; Thanks again, Roque edit - added the code |
Topic | Author | Date |
8051 & L6219 (Stepper Motor Driver) | 01/01/70 00:00 | |
CNCZone | 01/01/70 00:00 | |
Maybe this will help | 01/01/70 00:00 | |
this helps a lot | 01/01/70 00:00 | |
Think Search and Replace | 01/01/70 00:00 | |
static | 01/01/70 00:00 | |
static about 'static' and 'code' | 01/01/70 00:00 | |
That's modularity for you! | 01/01/70 00:00 | |
Different Reason | 01/01/70 00:00 | |
Concepts | 01/01/70 00:00 | |
Imprecise comment | 01/01/70 00:00 | |
Another imprecise comment | 01/01/70 00:00 | |
Ah... That is the catch :) | 01/01/70 00:00 | |
Better | 01/01/70 00:00 | |
Yup | 01/01/70 00:00 | |
Works Beautifully | 01/01/70 00:00 | |
Another happy ending | 01/01/70 00:00 | |
One more problem - Direction | 01/01/70 00:00 | |
Extra Table Shouldn't Be Necessary | 01/01/70 00:00 | |
thats what i thought too | 01/01/70 00:00 | |
nevermind i screwed up...![]() | 01/01/70 00:00 | |
Visit Jones on Stepping Motors | 01/01/70 00:00 |