I’m new to programming Vex, and I’m encountering some frustrating limitations with the EasyC programming kit(V1). Foremost is the distinction between Autonomous and competition modes. The only blending of the two modes can hapen in two loops, but I’ve been trying to write a program to control my 4- wheel holonomic drive and the instant I drop a motor module command that uses a variable from GetRx into a program, the controller no longer reponds to any Rx commands, appearently because I’ve mixed blocks from the Rx and comp modes.
Is there a way around this in EasyC? Within the same loop, I need to put Rx channel inputs into variables, modify them mathmatically, and then output to the motors using the motor module, not the motor module Rx, using the new variable information.
Is there no provision for this kind of blending of Rx input and Autonomous motor control within EasyC? Or is it only one mode ot the other, within different loops- as it appears.
This is driving me crazy- thanks in advance for any help.
I am almost sure that you can do what you want with easy C. However, I am having some trouble following what you want to do exactly and figuring out your problem. If you wish to drive your holomic robot, do not use both the RC driving blocks (i.e. two-motor or four-motor drive) and the motor module blocks. Simply use the motor blocks with the output being a variable. For example;
Retrieve a value from the joysticks using the Rx input block and set it to a variable.
Modify the variable however you like
Set the variable to a motor module with the output being that variable. Your robot will now drive based on how you modify the values being retrieved from the joysticks. For a program like this, there is no difference between easyC v1 or v2.
Hope this helps. If you still can’t get it to work don’t be afraid to come around these parts again .
Yes, this is exactly what I have in my program. I Put joystick values into variables for each axis, modify the variables, and then use the motor module blocks with the output being these modified variables fetched from GetRx Blocks. I use no RC driving blocks. The problem is, that the GetRx commands do not work when I have the motor block (non-Rc) with the variable outputs in the same loop. The Green activity light for Rx does not even come on on the controller. By using the print to screen block, I can see that the varables Fetched from GetRx are not changing at all as I move the joysticks. But, if I eliminate the motor module blocks, and re-download the program, all of a sudden the Rx activity light works, and the GetRx variables printed out to the screen change as they should. If i drop in just a single motor module block using one of these variable, then all Rx functionality goes away again.
It’s like the motor module is a poison block when used in the same loop as GetRx that kills RC inputs. I suspect that this has to do with keeping the notions of autonomous and competition modes strictly enforced, so I hope that there is a way to circumvent this problem. I’ve tried using the code exaclty as above from the “It’s a Vex Holonomic Drive!” thread, with the same problem.
I’m using Master Code 5, and the header on the EasyC i/o block is #include “UserAPI.h” while the holonomic code above has #include “main.h”
I wonder if that has anything to do with it?
I had the same problem, so I am trying to “trick” the software. I tried making the motor functions part of a user block and modifing them there, like
SetMotor(1,(leftjoystickvalue*(465/500))
or something like that, I’m too lazy to get the real code , but it didn’t work :mad: . Maybe I’ll try the goto C command. I heard someone say that the VEX kit checks to see if one modifies the variables in the same loop as an RX block. The goto command could probably trick it. Does it work in EasyC?
Update: the goto command works, but it didn’t trick the vex kit.
I encountered the same problem, and the Intelitek help forum folks were not helpful at all. I did not figure out how to get around it.
If anyone HAS figured out how to have the Vex bot do some autonomous stuff, but able to be overridden by the transmitter (using the GetRX command, for instance) PLEASE share what you know.
I am sure that what I’m trying to do - let the robot do it’s own thing, but allow inputs from the OI override anything - can be done with FRC. The vex controller is something else - I have a feeling the issue is related to EasyC and not the hardware.
I will try the SetPWM() function as UnderDark suggests before I whine any more. Though I might try the EasyC 2.0 version, see what that does.
I think I understand what you are attempting to do, however, I’m not sure. Perhaps if you posted your easyC code (not the blocks, just the text in the window on the right), it would be easier to diagnose your problem. I am 99.9% sure that the problem is not easyC, as there are no real limitations in the software itself.
If vex EasyC is anything like FRC EasyC then I believe you can choose not to build your project in a competition format. See if there is a option for that.