Hello, I need help with some code I just wrote. I’m a pretty terrible programmer overall, but I am also working alone this year so I need to be able to learn to program. I was initially trying to make a split arcade drive (like I have working in VexCode V5 Text) in PROS. Seeing as that failed, I simplified in hopes of making SOMETHING work, but no luck even with what is basically the example code. Here’s what I have for Split Arcade:
Thank you Weilin. I’ll test. Also worth noting it may be the Move command I used which seems to take values between -127 and 127. Not sure if those motor power variables I had are going way higher or not. I just tried to mimic the code I had in VexCode…
I did notice that yes. However, I’m trying to basically convert my working code from Vexcode over, so that’s why I have the powers for the motors calculated the way I do. What function would you suggest using for that purpose? In VexCode I was using the spin command with velocity as a percent.
Also, I tried just doing printf(“testing”); in my while loop, when I turn on the program all I get is a gray screen. Not sure if this is some stupid LVGL thing plaguing me (I do have a working auton menu, I don’t know how it interacts with Opcontrol).
I’m not sure what else I can do. The definitions at the top are still the same. All I’m doing is entering the program from the menu normally. No competition switch or anything. Assuming this enters the Opcontrol function, I’m not sure what else to try.
Can you explain exactly what the problem is? Does the program not run, or does the robot not move when the program is run?
As far as I know, printf() doesn’t print to the brain screen, and I’m pretty sure that the grey screen is just the default LVGL output (assuming you removed LLEMU)
PROS printf output goes not to the V5 brain screen but to the terminal window of the connected computer by design. This tutorial talks about how to work with it:
Also, you can try to get one of the PROS clawbot tutorials that is known to work as the starting point for your program.
If all else fails, you could switch from PROS to VEXcode Pro, which has a convenience functions to print on V5 screen and a number of builtin sample programs.
Thanks, that would explain it. I looked into the printf a bit but I didn’t realize it went to the terminal. I was basically using the clawbot tutorial by the end of my testing (as in it was that simple) so I’ll have to keep fiddling with it until I get something working I guess.
As much as going back to VexCode is an option, I potentially wanted to use Okapi for odometry (provided I get meaningful access to a field this season to do auton) and I already have that auton menu which I really want to be able to implement. So, that would be worst case scenario…
Okay, problem solved. Literally all that was happening is my code was not downloading. I had been hitting the upload button, which is apparently not valid. Turns out you have to go save and then potentially the only button that can be used is the PROS Quick Action one. I figured out the terminal stuff, so thanks for that @weilin. Anyway that clears up all my issues for now, I might pm you if I run into any more later on.