Closed sevenbitscience closed 1 month ago
Control will happen within the while (opModeIsActive())
loop
Servos move when you call the setPosition
, and motors move when you call the setPower
Both of those functions take a double (decimal number) as input
FTC SDK provides two variable for input from the gamepads
gamepad1
and gamepad2
You get input from the user from variables inside of those things
We can get:
You get one of these values by calling something like this
gamepad1.a
If you keep track of how the inputs are changing over time, you can do edge detection
You can use logic stuff to control how you move the stuff based on what input you are getting
You probably want to make sure that when you're pressing nothing, the stuff is not moving
I created some basic stuff, probably needs heavy adjusting. When Joey is back I think he'll help review code and then I can commit it.
You could commit it to your branch, I can probably take a look sometime tonight (till like 2 AM your time)
Oh my bad, didn't see this till now 😅😅
I found some things to revise and I am going to rewrite some of it
I think I committed it, let me know if it didn't work
We tested the drive, and it needs some improvements. The first change is that it currently rotates in the opposite direction that we want it. It also currently does not have any speed control, so we would like to add that. It could also be beneficial to improve the control flow for the driving code.
Make some basic controls that can drive the robot forwards and backward, as well as rotating to turn left and right