Update sample OpMode links from WestsideRobotics repo to FTC WikiSupport repo
@ -85,7 +85,7 @@ The method contains only one line of instruction, on Line 15: **three text items
|
||||
|
||||
That's it for the Java! Click the wrench icon to **_Build Everything_** including your new class. If there are error messages, read carefully and fix any mistakes. When you see "Build Successful!", your new myBlock is ready to use.
|
||||
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. OnBot Java helps by suggesting some code as you type, and by entering import statements when classes are used. Android Studio helps even more. If you require pre-typed text of this example, click [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/SampleMyBlocks_v00.java).</i>
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. OnBot Java helps by suggesting some code as you type, and by entering import statements when classes are used. Android Studio helps even more. If you require pre-typed text of this example, click [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/SampleMyBlocks_v00.java).</i>
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
|
||||
@ -228,7 +228,7 @@ Here's a very simple example to illustrate how a myBlock can access the **robot
|
||||
|
||||
<p align="center">[[/images/Custom-FTC-Blocks-(myBlocks)/a0300-wiggle-OBJ-short.png|wiggle servo - Java code]]<p>
|
||||
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. It's good practice! If you require pre-typed text of this example, click [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/SampleMyBlocks_v01.java).</i>
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. It's good practice! If you require pre-typed text of this example, click [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/SampleMyBlocks_v01.java).</i>
|
||||
|
||||
Lines 10-11 contain two strings of text (each in quotes), joined with a **"+"** character to form a **single text string**. This is an alternate way to meet the requirement that a comment field must be a **single line** of text, with no 'line break'. Shorter strings allow all the text to be visible on-screen, without scrolling sideways.
|
||||
|
||||
@ -261,7 +261,7 @@ CONs of hard-coding:
|
||||
|
||||
> <i>Note: As a programmer, you will constantly face choices like this, with pros and cons. This is part of software design, a key professional skill and career path.</i>
|
||||
|
||||
A **different version** (gamepad-controlled, fully commented) of the above Java program is provided [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/SampleMyBlocks_v02.java). It illustrates using 5 of the 6 objects provided by BlocksOpModeCompanion, including **telemetry** and the **gamepads**. This longer example, or the short version above, could be used in an OpMode like this:
|
||||
A **different version** (gamepad-controlled, fully commented) of the above Java program is provided [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/SampleMyBlocks_v02.java). It illustrates using 5 of the 6 objects provided by BlocksOpModeCompanion, including **telemetry** and the **gamepads**. This longer example, or the short version above, could be used in an OpMode like this:
|
||||
|
||||
<p align="center">[[/images/Custom-FTC-Blocks-(myBlocks)/a0320-wiggle-OpMode.png|wiggle servo - OpMode]]<p>
|
||||
|
||||
@ -336,7 +336,7 @@ Here's the myBlock in a repeat loop, with its **comment** and **tooltip**:
|
||||
|
||||
Again, the comment field is the only way to communicate with future users of your myBlock. They cannot see your Java code or its Java comments. Keep your myBlocks interface simple, and the instructions clear.
|
||||
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. OnBot Java helps by suggesting some code as you type, and by entering import statements when classes are used. Android Studio helps even more. If you require pre-typed text of this example, click [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/SampleMyBlocks_v03.java). The linked copy includes more Java comments, omitted above to focus on the Java code. Also not shown are the package and import statements.</i>
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. OnBot Java helps by suggesting some code as you type, and by entering import statements when classes are used. Android Studio helps even more. If you require pre-typed text of this example, click [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/SampleMyBlocks_v03.java). The linked copy includes more Java comments, omitted above to focus on the Java code. Also not shown are the package and import statements.</i>
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
|
||||
@ -369,7 +369,7 @@ Here are the Robot A and Robot B myBlocks, each with its **comment** balloon and
|
||||
|
||||
<p align="center">[[/images/Custom-FTC-Blocks-(myBlocks)/a0510-non-myBlock-method-Blocks.png|non-myBlock method - Blocks]]<p>
|
||||
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. If you require pre-typed text of this example, click [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/SampleMyBlocks_v04.java). The linked copy includes a proper/full amount of Java commenting, omitted above to focus on the Java code. Also not shown are the package and import statements.</i>
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. If you require pre-typed text of this example, click [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/SampleMyBlocks_v04.java). The linked copy includes a proper/full amount of Java commenting, omitted above to focus on the Java code. Also not shown are the package and import statements.</i>
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
|
||||
@ -391,7 +391,7 @@ Write and read actions can happen in the same OpMode or **different OpModes**, a
|
||||
|
||||
- A **dedicated log file** reports key sensor data in a custom format, with optional time-stamps. For program development and debugging, this could be more efficient than working with the large standard logs or Match Logs.
|
||||
|
||||
The Java code for this example is available [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/SampleMyBlocks_v05.java), with **extensive comments** that explain some unfamiliar Java expressions. The code can be copied and pasted directly into OnBot Java or Android Studio.
|
||||
The Java code for this example is available [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/SampleMyBlocks_v05.java), with **extensive comments** that explain some unfamiliar Java expressions. The code can be copied and pasted directly into OnBot Java or Android Studio.
|
||||
|
||||
> <i>Programming tip: Instead of memorizing every possible Java command, programmers often study and modify existing code for a similar task. Unfamiliar commands are explored with an internet search, reference book, at the [FTC Javadoc reference](https://javadoc.io/doc/org.firstinspires.ftc), or at the official [Oracle Javadoc](https://docs.oracle.com/javase/7/docs/api/).</i>
|
||||
|
||||
@ -423,9 +423,9 @@ Here's the Java code for the method only:
|
||||
|
||||
<p align="center">[[/images/Custom-FTC-Blocks-(myBlocks)/a0610-Telemetry-interval-Blocks.png|myBlock code to change telemetry interval]]<p>
|
||||
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. If you require pre-typed text of this example, click [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/W_myBlocks.java). The linked copy includes the usual class declaration and package/import statements.</i>
|
||||
> <i>Note: this tutorial intends for you to **manually type** the Java code above. If you require pre-typed text of this example, click [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/W_myBlocks.java). The linked copy includes the usual class declaration and package/import statements.</i>
|
||||
|
||||
Want to verify this actually works? Another, slightly more advanced myBlock allows measuring the time between Telemetry updates; it's posted [here](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/W_myBlocks_Telemetry_v02.java). That myBlock can be used in a Blocks program like [this](https://github.com/WestsideRobotics/FTCmyBlocks/blob/main/Examples/W_Telemetry_myBlocks_v02.blk); download the raw **.blk file** and click the **Upload Op Mode** button at the main Blocks menu. Read all comments and instructions.
|
||||
Want to verify this actually works? Another, slightly more advanced myBlock allows measuring the time between Telemetry updates; it's posted [here](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/W_myBlocks_Telemetry_v02.java). That myBlock can be used in a Blocks program like [this](https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/SampleOpModes/Custom-FTC-Blocks-(myBlocks)/W_Telemetry_myBlocks_v02.blk); download the raw **.blk file** and click the **Upload Op Mode** button at the main Blocks menu. Read all comments and instructions.
|
||||
|
||||
[<p align="right"><i>Return to Top</i>](#introduction)<p>
|
||||
|
||||
|
Reference in New Issue
Block a user