is that how the robot moves? or is that just the code to switch velocity?
Code to change velocity, I don’t have the text for the joystick telling the drivetrain to spin forwards or stuff like that.
do you uae the automatic code for it? like where you bind it to the controller?
Yes, I do. I am in middle school and haven’t taken the time to learn C++ for this yet.
ok, what is happening is that the automatic driver control code sets the velocity to the axis position on the controller, then you change it to only being 40%, so nonmatter where the controller is, the drive train will go 40%
I’m in middle school too, but I do text coding. Maybe you should try Python first, or go to Robotify. they have great coding courses.
Ok, I programmed Lego robots in text, but I forgot how to.
ah. I did legos too, but I could never find any text coding.
Correct, this is what I want to happen. The issue is that is wont turn or go in reverse and we can’t figure out why.
I was a special program you had to download onto a micro sd and replace it with the one in the cortex
yeah, 40% is forward, and -40% is backwards
Ohhh, ok. How would I make it be able to turn and go backwards with that.
The other issue is that when this code was there, it would still only go forwards, even when the button wasn’t pressed.
what do you have the drive train bound to? example:
Also, there is a dark mode?
you can try something like this, it sets the velocity to the (axis position * 40)/ 127 (which is the max value), so that when the axis value is the max (127), the value is 40, and when it is at it’s minimum (-127), the value is -40.
yes, i think it is only in Vex code pro though
So I could use something like this then put it in and if statement so it would be
If Controller 1 A pressed
do that line of code
yes, but you will need to keep it pressed, so it keeps updating, what you could do is make it so that it toggles the variable itself.
which makes a variable named max set to 100
than the variable max changes what the max value
and you could make the else an else if controller button b to make it toggleable rather than requiring to be held down