|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#10
|
||||
|
||||
|
Re: Vex Programming Question
Quote:
When I was first learnign to us EasyC, and I scanned the list of commands available in the "palettes"; I saw several that send something out to a PWM port. Among these, two under the heading of Outputs were Motor Module and Servo Module. Why on Earth there were two for doing exactly the same thing confused me. Whether a motor or a servo is connected to the computer is completely hidden from the software. Then, under the heading of RC Control, I found Motor Module Rx and Servo Module Rx. Like the two mentioned above, why two existed to do the same thing confused me; and why on Earth they have Rx in their names when their job is to control output ports made them even more perplexing. Also these two had an annoying list of cryptic input parameters that (unlike named variables) would make no sense to me 5 minutes after I set them. Four others, also found in the RC Control palette, Arcade 2 motor, Tank - 2 motor, Arcade 4-motor, and Tank 4-motor had even longer lists of cryptic parameters waiting to entangle me... yuck. If only there was an elegant, pure, simple command to just tell a PWM port what to emit, one without any other baggage attached to it. Oh, wait! There it is, the PWM Control command. But maybe not.... Hmmm, why is PWM Control under the RC Control palette? Neither its description nor its parameters make any mention of the transmitter or receiver; but then again, why should they? This command just tells a PWM port what to emit. Oh well, trying to guess the ancient quirks of coding preferences that lead to all these confusing names and palette organizations is a fool's errand. I'll trust the documentation and use the PWM Control command. It is simple and based on what I can read about it, it carries no extra baggage. Well... thereby hangs a tale (more than one apparently). KingofI337 says below (thank you King) that older versions of EasyC had a hidden linkage between PWM Control and whether or not the microcontroller (plus the implied receiver...) detected a valid signal from a transmitter. He says this is gone from more recent Vex EasyC versions. When we use those older versions, if we want to control PWM ports regardless of what is coming into the microcontroller from the receiver, I think we are supposed to use the Motor Module or Servo Module command(s) instead of the PWM Control command. I assume that which one you choose (Motor Module or Servo Module) is irrelevant, but I already guessed incorrectly above, so maybe they do have hidden differences and you shouldn't use my guesses (yes - I know that when given the same PWM signal, motors and servos rotate in different directions, but do the software "guts" of these functions contain any non-trivial differences???). So, for purely autonomous operation (no Transmitter needed) I think you remove all PWM Control commands and replace them with Motor/Servo Module commands. For autonomous operation when a transmitter is on (perhaps followed by teleoperated operation) I think you can use all PWM Control commands or all Motor/Servo Module commands If you want to mix Motor/Servo Module Commands and PWM Control commands in the same program, I seem to remember two things.
Blake PS: If my recommendations are wrong, please enlighten me/us. I freely admit that I was never the world's expert on this, and that I have been away from this side of things for a while. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Vex w/ MPLab | dababyjebus | FIRST Tech Challenge | 27 | 25-04-2008 09:11 |
| VEX programming | Gene F | Programming | 14 | 08-08-2006 22:21 |
| Programming VEX Controller | HRobotics | Programming | 4 | 21-03-2006 23:25 |
| Vex like programming? | Morenoh149 | Programming | 2 | 09-07-2005 22:32 |
| Vex Programming | foobert | FIRST Tech Challenge | 3 | 24-06-2005 01:09 |