Go Down

Topic: help micro elevator code (Read 3 times) previous topic - next topic

copachino

yes and also my code compile, but its 100% my code doesnt work.... it need tobe changed

AWOL

Well, you need to fix the problems already pointed out.
Then you need to run it, and figure out what it is that it does that you didn't expect it to, and what it didn't do that you did expect it to.
Debug prints are useful for this.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

copachino

yes i now, but i can test it till tomorrow when the stepper driver its ready, but i need to know now how can i make the stepper to run without tellihn how many steps i need to move it

PaulS

Quote
reading the state of the pins would be like this right

Yes, but...

Later in your code, what does val1 mean? Could you infer what floorSwitchState1 meant? Which is easier to understand?

Now, it makes no difference to the compiler. Everything is translated to a memory address as far as the compiler is concerned. But, long before the compiler has spent a few seconds with your code, you (and we) will have spent hours trying to understand what it is doing. Why not make it easy on yourself and use meaningful names?

Docedison

Could this be a case of the elevator not going all the way to the top?

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Go Up