We are planning to program an arm to reach 3 pre-set heights (in EasyC v4). During operator control, we would like to use 3 of the 4 buttons on Channel 7 or 8 to trigger the arm to these heights. I’ve looked at a few threads on this topic and have a few questions.
-
We’ve looked at using the Joystick to digital input but were wondering if it would be more efficient to use an interrupt, since we wouldn’t be continually using the “jump to level 1/2/3” function as much as we use direct control of motors with joystick buttons. I don’t have a very good concept of interrupts and am not sure how the buttons on Channel 7 could be used to trigger one, so if this is a good solution, any explanation would be appreciated.
-
Is it better to program the arm to continue raising until it reaches a certain height (ignoring operator control), or to allow O/C to occur simultaneously? Or would it be better to ignore O/C input but have an “override” condition (perhaps the 4th unused button) that kicks the program out of its arm-raising task and restores Operator Control in an emergency?
-
Any opinions or cautions on using Switch/Case rather If/Then/Else? We’ve used the latter, but not the former.
-
Are there any multi-tasking issues that I should be aware of?
-
Any suggestions on threads on this topic? The ones I’ve been using are:
https://vexforum.com/t/single-button-actions-on-controller/18364/1
[https://vexforum.com/t/easyc-project/15588/1
This is the first year in quite a while when we’ve had the mechanics of the robot completed more than a week before competition and programmers who are potentially capable of the above, so these are uncharted waters for us.](https://vexforum.com/t/easyc-project/15588/1)