https://github.com/jthftc/ftc-teamcode
:book: Our Repository for All Previous Years of the JTH JAVA Program.
https://github.com/jthftc/ftc-teamcode
ftc-sdk ftc-teamcode java opmode
Last synced: 6 months ago
JSON representation
:book: Our Repository for All Previous Years of the JTH JAVA Program.
- Host: GitHub
- URL: https://github.com/jthftc/ftc-teamcode
- Owner: jthftc
- Created: 2020-11-19T13:11:39.000Z (about 5 years ago)
- Default Branch: 2020-2021
- Last Pushed: 2021-09-04T23:34:20.000Z (over 4 years ago)
- Last Synced: 2025-01-11T18:26:15.536Z (about 1 year ago)
- Topics: ftc-sdk, ftc-teamcode, java, opmode
- Language: Java
- Homepage: https://github.com/jthftc/ftc-teamcode/wiki
- Size: 107 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
README
# FTC TeamCode Repository 🤖
[](https://javathehutts.org)
[](https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fgithub.com%2Fjavathehutts&screen_name=javathehutts)
[](https://instagram.com/jthftc)
## Getting Started With Java
To start off with, you are going to need to download the current [FTC SDK](https://github.com/FIRST-Tech-Challenge/FtcRobotController) from the Official First Technology Challenge Github page. This will include a .zip file that includes all of the base structures that your team is going to need in order to develop a functional Java program.
Next, your going to need to either setup an [OnBotJava](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/OnBot-Java-Tutorial) or [Andriod Studio](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Android-Studio-Tutorial) environment for editing and compiling your Java projects. The links in the previous sentence will bring you to the respective tutorials provided by First Robotics.
## Developing an OpMode:
### Basic Template
To begin creating your first java program, open up your /teamcode folder within your [FTC SDK](https://github.com/FIRST-Tech-Challenge/FtcRobotController) and create a new file named ```main.java```. Next copy and paste the following template into this new java file. This template includes basic imports, class syntax, and the ```init()```/```loop()``` in which will help define our robot objectives during the TeleOp period.
```java
package org.firstinspires.ftc.teamcode; //This may change depending on where this file is stored
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor; //Needed for Motor Control
import com.qualcomm.robotcore.hardware.DcMotorEx; //Needed for Motor Control
import com.qualcomm.robotcore.hardware.Servo; //Needed for Servo Control
import com.qualcomm.robotcore.util.ElapsedTime;
@TeleOp(name="main", group="Opmode") //Name & group of OpMode within the Driver Station Phone
@Disabled //Remove when finished and ready for testing
public class main extends OpMode {
@Override
public void init() {
//Initialization Code
}
@Override
public void loop() {
//Loop Code
}
}
```
### Initializing Motors
### Controlling Motors
### Initializing Servos
### Controlling Servos
### Exporting OpMode
### Adjusting OpMode Based Upon Drivetrain
---
### Connect with us:
[
][website]
[
][facebook]
[
][twitter]
[
][instagram]
[
][youtube]
[
][reddit]
---
[website]: http://javathehutts.org
[twitter]: https://twitter.com/javathehutts
[youtube]: https://youtube.com/channel/UC7lOdu9FJqzLBgwIap4CDhw
[instagram]: https://instagram.com/jthftc
[facebook]: https://www.facebook.com/Javathehutts/
[reddit]: https://www.reddit.com/user/JavaTheHutts/