Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/stage0/snippets/JavaFundamentals.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@

void main() {
// [printLiteral]
System.out.print("hello!");
System.out.println("hello!");
// [/printLiteral]

// [printVariable]
int number = 4;
System.out.print(number); // prints out the value 4
System.out.println(number); // prints out the value 4
// [/printVariable]

// [singleLineComment]
// This prints Hello World
System.out.print("Hello World");
System.out.println("Hello World");
// [/singleLineComment]

// [inlineComment]
System.out.print("Hello World"); // This prints Hello World
System.out.println("Hello World"); // This prints Hello World
// [/inlineComment]

// [multiLineComment]
/* This prints Hello World
This is another line */
System.out.print("Hello World");
System.out.println("Hello World");
// [/multiLineComment]
}
19 changes: 11 additions & 8 deletions examples/stage0/snippets/Operators.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,39 @@
void main() {
// [multiplication]
int magicNumber = 6;
System.out.print(magicNumber * 2);
System.out.println(magicNumber * 2);
// [/multiplication]

// [increments]
int x = 6;
int y = 7;

System.out.println(x++);
System.out.println(y--);
x++; // x is now 7!
y--; // y is now 6!

System.out.println(x); // prints 7
System.out.println(y); // prints 6
// [/increments]

// [arithmetic]
int a = 10;
int b = 5;
a += 1;
a += 2;
b -= 1;

System.out.println(a); // prints 11
System.out.println(a); // prints 12
System.out.println(b); // prints 4
// [/arithmetic]

// [comparison]
int c = 2;
int d = 4;
System.out.print(c > d);
System.out.println(c > d); // prints false
// [/comparison]

// [logical]
boolean fiveIsGreaterThanThree = 5 > 3; // True
boolean nineIsLessThanTwo = 9 < 2; // False
boolean fiveIsGreaterThanThree = 5 > 3; // true
boolean nineIsLessThanTwo = 9 < 2; // false

System.out.println(fiveIsGreaterThanThree && nineIsLessThanTwo);
System.out.println(fiveIsGreaterThanThree || nineIsLessThanTwo);
Expand Down
6 changes: 4 additions & 2 deletions src/content/docs/learning-course/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ next: false

import CourseSection from '@components/CourseSection.astro';

Welcome to FRCSoftware's learning course! The purpose of this course is to help students learn how to program an FRC robot no matter their skill level.
Welcome to FRCSoftware's learning course!
The purpose of this course is to help students learn how to program an FRC robot no matter their skill level.
The progression of the course moves from learning how to write Java to programming robots of increasing complexity.
We start individual mechanisms of robots, using the FRC Kitbot, then move to more complex robots.

Software in FRC is always changing! If you want to give feedback or have comments, feel free to do so through our [Github](https://github.com/frcsoftware/frcsoftware.org)
Software in FRC is always changing!
If you want to give feedback or have comments, feel free to do so through our [GitHub](https://github.com/frcsoftware/frcsoftware.org)
or [Discord.](https://discord.com/invite/uUugPrPZFs)

<CourseSection
Expand Down
30 changes: 17 additions & 13 deletions src/content/docs/learning-course/stage0/java-fundamentals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,26 @@ It helps tell our program more information about our variables such as what type
Data types can include numbers, characters, or a string of words.
Some example data types that are commonly used in FRC programming are:

- int: integer numbers that are positive or negative.
Int only allows numbers without decimals.
- int: Integer numbers that are positive or negative.
int only allows numbers without decimals.
Example: 12
- double: numbers that are positive or negative.
- double: Numbers that are positive or negative.
Unlike int, double allows numbers with or without decimals.
Example: 34.1
- boolean: either True or False.
- string: holds a sequence of characters.
- boolean: Either `true` or `false`.
- String: Holds a sequence of characters.
Denoted by double quotes (").
Example: “Hello World”
- char: holds a Single character.
- char: Holds a single character.
Denoted by single quotes (').
Example: 'A'

The name of your variable can be whatever you want, but it should be easy to read and make sense to others who may be reading your code.
Some rules for variables include not using spaces, instead you writing variables with camel case (frontLeftDrive).
Upper snake case (FRONT_LEFT_DRIVE) can be used for constants, which we will learn about later in the course.
It should also be noted that variable names can have numbers at any point except for the first character.
The name of your variable can be almost anything you want, but it should be easy to read and make sense to others who may be reading your code.
One major exception is spaces, which are forbidden in variable names.
Instead, you should write variables in what's known as camel case (`frontLeftDrive`).
Upper snake case (`FRONT_LEFT_DRIVE`) should be used instead for constants, which we will learn about later in the course.
Variable names can have numbers at any point except for the first character.
(`motor2` is a valid name, `2motor` is not).

<Aside type="note">
Java is a case-sensitive programming language!
Expand All @@ -77,8 +81,8 @@ Semi-colons are used commonly in programming and aren’t only for creating vari
We will see more examples of this later in the course.

In FRC, variables can be used to hold information about the robot and its different mechanisms.
The example below shows 3 variables that were used for a climber mechanism, CLIMBER_ID is an integer that holds the motor controller ID number which is 51.
UP_POSITION is a double that holds the value -33.5 and DOWN_POSITION is a double that holds the value 0.
The example below shows 3 variables that were used for a climber mechanism, `CLIMBER_ID` is an integer that holds the motor controller ID number which is 51.
`UP_POSITION` is a double that holds the value -33.5 and `DOWN_POSITION` is a double that holds the value 0.

```java #variables

Expand Down Expand Up @@ -138,7 +142,7 @@ Whether you put your comments preceding or alongside code is up to you and what

Multi-line Comments start with `/*` and end with `*/` The text or code that is in between the two will turn into comments.
Multi-line Comments are commonly used when you have many lines of text or need to turn a large amount of code into a comment.
For example, this is a comment with two lines of text
For example, this is a comment with two lines of text.

```java #multiLineComment

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/learning-course/stage0/operators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,20 @@ For now, we can use the operators to change variables without using conditionals
<tr>
<th>Operator</th>
<th>Description</th>
<th>Compatible Data Types</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>`++`</td>
<td>Increment: add 1 to a variable</td>
<td>Increment: adds 1 to a variable</td>
<td>int, double</td>
<td>`a++`</td>
</tr>
<tr>
<td>`--`</td>
<td>Decrement: subtracts 1 to a variable</td>
<td>Decrement: subtracts 1 from a variable</td>
<td>int, double</td>
<td>`a--`</td>
</tr>
Expand Down
3 changes: 2 additions & 1 deletion src/content/docs/learning-course/stage1/stage-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ prev: false
next: stage-1a/stage-overview
---

Congratulations! Whether you already know Java, have programmed an FRC robot before,
Congratulations!
Whether you already know Java, have programmed an FRC robot before,
or are a complete beginner, you should have a good grasp of the basic syntax of the Java language by now.
In Stage 1, we'll be moving on to the exciting part: actually writing code for a robot!
It might seem daunting at first, but the best way to think through it is to focus on understanding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ You can see that all the `Main.java` file is doing is, quite literally, starting
so there's really no reason to edit this file for now.

<Aside type="note">
Notice that the names of all Java files in the project are capitalized. This
is a convention you should follow throughout your code.
Notice that the names of all Java files in the project follow PascalCase,
where the first letter of every word is capitalized. This is a convention
you should follow throughout your code.
</Aside>

### `Robot.java`
Expand Down Expand Up @@ -103,15 +104,17 @@ We've set this up for you already; you'll just have to set up the simulation sof

### The 2026 Kitbot

But what is all this code actually going to control? Well, the answer is the 2026 FIRST Robotics Competition kitbot, the best starting point
But what is all this code actually going to control?
Well, the answer is the 2026 FIRST Robotics Competition kitbot, the best starting point
for new FRC teams, as well as the simplest robot to get fully working.
You can watch the below video to learn more about what functionalities the kitbot has.
If you're a bit confused after watching that video, don't worry.
We'll explain the kitbot more in depth in the next section.

<YouTube url="https://www.youtube.com/watch?v=nTmZXOgHntM" />

And that's all you need to know to get started! The rest of Stage 1A will cover how to get from the template code to a working kitbot.
And that's all you need to know to get started!
The rest of Stage 1A will cover how to get from the template code to a working kitbot.

This stage will cover the following topics:

Expand Down