![]() |
Limit Switches
How can we go about thoroughly programming the limit switches to control a specific motor using MPLab,
ex: if ((dig_in03)) { pwm03 = p3_y; } else { pwm03 = 127; } Is that the correct way? Any help would be greatly appreciated, Thanks! |
Re: Limit Switches
You're up a bit late, aren't cha? (Or early? Do programmers ever get to see the sun?) :cool:
I think it's rc_dig_in03. Here's some code we had from last year, using joystick 2 y-axis to move the grabber arm up or down (like your lower arm with the motor at the elbow). We had a limit switch (LS) at the top and bottom to stop the motor, but allows it to go the other way even if it reaches the limit switch. Code:
//-------------------------- ARM WORK 3 -------------------------------------This wasn't our final code, but it did work at the time. As always YMMV. ______________________ One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs. |
Re: Limit Switches
Hey, thank you so much! It worked!
|
| All times are GMT -5. The time now is 08:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi