Difference between revisions of "FTC Make Coding Easier with Methods 20230112"
From wikidb
(→Using the Android Debugging Bridge to Locate Bugs) |
|||
Line 15: | Line 15: | ||
# Modify the program to move forward 18 inches, turn left 90 degrees, and move backward 12 inches. | # Modify the program to move forward 18 inches, turn left 90 degrees, and move backward 12 inches. | ||
# Modify the program to work with 4 motors so you can support the Mecanum drivetrain. | # Modify the program to work with 4 motors so you can support the Mecanum drivetrain. | ||
+ | |||
+ | = Refined Demo Code = | ||
+ | |||
+ | '''TBD''': Complete code refinements and integrate into this lab. | ||
+ | |||
+ | * [https://github.com/edcepp/DeLaSalle/blob/main/DriveMecanumEpp.java DriveMecanumEpp.java] | ||
+ | |||
+ | Simplified PowerUpMotors to us Ticks for distance and velocity. Add GoForward and GoSideways helper methods | ||
= Using the Android Debugging Bridge to Locate Bugs = | = Using the Android Debugging Bridge to Locate Bugs = |
Revision as of 08:53, 24 March 2023
Contents
Why Use Abstraction
- Makes the program easier to think about
- Makes is easier to test programs - we can test small part individually
- Makes the code easier to user over and over saving time. We can more easily takes code from one program and use it somewhere else.
- Makes code more reliable by allowing us to use the same code over and over.
Move the Robot in a Square Demo Code
Check Points
- Copy the Drive In A Square program to your robot and test it.
- Investigate a simplified outline of the move in a square program to help you understand how to write methods. See FTC Drive In a Square Outline 20230112.
- Modify the program to move forward 18 inches, turn left 90 degrees, and move backward 12 inches.
- Modify the program to work with 4 motors so you can support the Mecanum drivetrain.
Refined Demo Code
TBD: Complete code refinements and integrate into this lab.
Simplified PowerUpMotors to us Ticks for distance and velocity. Add GoForward and GoSideways helper methods
Using the Android Debugging Bridge to Locate Bugs
- FTC adb Android Debugging Bridge 202008: My notes
- DriveInASquareEppLog.java: The Drive in a Square program with debugging capabilities added.
- FTC Starting up the Debugger Summary 20230308
- DriveInASquareEppLog.txt: Example subset of log file
Additional References
To be screened.