Skip to content
Open
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
5 changes: 4 additions & 1 deletion docs/how-to-docu/Blank File.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ sidebar_position: 100
# Blank Docusaurus File

## Why?
This is a blank docusaurus file that can be copied in Visual Studio to serve as a basis for new webpages.
This is a blank docusaurus file that can be copied in Visual Studio to serve as a basis for new webpages.

## Sources
[Example Source](https://docusaurus.io/)
34 changes: 0 additions & 34 deletions docs/how-to-docu/first-blog-post.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/how-to-docu/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_position: 0
---
# Docusaurous Intro
# Docusaurus Intro

Let's discover **Docusaurus in less than 5 minutes**.

Expand Down
48 changes: 48 additions & 0 deletions docs/how-to/how-to-bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Programming Subteam Error Log

Welcome to the NoMythic Programming Error Log. This is a document created by Rowan Flood on Dec 5, 2024. the purpose of this document is to keep track of the tricky errors our subteam comes across. Every time we encounter an error message that takes a significant amount of finagling to get rid of, or that didn’t have in intuitive solution, write about it here! Copy the error message after you realise it’s gonna be a tough problem, and write the solution once you find it!

### TEMPLATE (copy then use):
#### Date, Year. Name:
Problem: make sure to include the exact error message copied from terminal or RioLog
Solution: specifically what you changed in order to solve the problem
Method (Optional): How you found the solution (for example: searching “this” on ChieffDelphi, asking ChatGPT, guessing)
2024/2025 season

#### December, 2024. Rowan Flood:
Problem: I am using the WpiLib 2024.1.1-beta-1 version of wpilibsuite, and when I built the code, I got this error code from AdvantageKit:
“The version of AdvantageKit installed in this project requires WPILib 2025.1.1-beta-1, but WPILib 2025.1.1-beta-2 is currently installed. Please update AdvantageKit and/or WPILib to compatible versions (the supported version of WPILib is listed in the release notes for each AdvantageKit version). DO NOT override this check; running with invalid versions will result in a broken project with issues that are difficult to diagnose.”

Solution: changing the 3rd line of build.gradle to say “2025.1.1-beta-1” instead of “2025.1.1-beta-2” as the version number for wpi.first.GradleRIO

Method (optional): I explained the situation to chatGPT, and fixed the error with one of the solutions suggested.

#### December, 2024. Rowan Flood, Xiaohan Liu:
Problem: when we built the code, we got this error from our launch.json file:
Unable to format JSON
Java.Lang.AssertionError: Unable to format JSON
Followed by a looong stack trace of could we didn’t make.

Solution: deleted commas after “true” and “false” in our launch.json file

Method (Optional): looked at template code that built just fine, and tried to find differences between the launch.JSON files. The only difference we found was two commas that weren’t in the template code

#### December, 2024. Rowan Flood:
Problem: code would crash immediately after starting if a USB drive was not plugged in for recording logs to. After plugging in a drive, we had to power cycle the robot before code would work. Here is the error message:

Solution: added code in Robot.java that checks if a USB drive is visible by the RIO, and - if not - prints an error message and saves logs to an internal file instead of attempting to save to the drive. Here is the code:

Method (Optional): pasted a picture of the error code into ChatGPT, than asked how to carry out the solution

#### 2025 February, Evan and Griffin
Problem: Deploy fails with the following error:
Execution failed for task ':deployfrcStaticFileDeployroborio'.
//> A failure occurred while executing edu.wpi.first.deployutils.deploy.artifact.ArtifactDeployWorker
// > SFTP error (SSH_FX_FAILURE): Failure

Cause: RoboRio internal storage was filled with log files, and there was no space to upload new pathplanner paths

Solution: Use filezilla or ssh to log into the roborio and delete log files
//> ssh lvuser@10.24.91.2 # Log into the roborio
//> du -sh logs # Should print a fairly large size, indicating a large number of logs on the roborio
//> rm -r logs # Delete all logs from the roborio
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ DrivetrainInputsAutoLogged inputs;

public DrivetrainSubystem() {
inputs = new DrivetrainInputsAutoLogged();
//define other Objects for the subsystem
//define other Objects for the
}
```


Expand Down
10 changes: 6 additions & 4 deletions docs/robot-docs/Replay Simulation/Sim Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ sidebar_position: 1
---

# Intro To Simulation
In FRC, Simulation is testing code without a physical robot. This allows you to quickly debug and develop code before the robot is made and while it is competing. Simulation comes in three main forms in order of difficulty: Running code on a laptop, simulating hardware, and simulating environment(not normally used in FRC).
In FRC, Simulation is testing code without a physical robot. This allows you to quickly debug and develop code before the robot is made and while it is competing. Simulation comes in three main forms in order of difficulty: Running code on a laptop, simulating hardware, and simulating environment (not normally used in FRC).

## Sources
[NoMythic_Simulation_Google_Doc](https://docs.google.com/document/d/13F6GO_e3fENr6bYeQux29UXtqi7mdO8z0uJELuAZY3Y/edit?pli=1&tab=t.ejcfcjau18wn)
[Mechanical_Advantage(6328)_Presentation](https://www.youtube.com/watch?v=8FfwFQcvRmU)
[WPILib_imulation](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/introduction.html)
[NoMythic Simulation Google Doc](https://docs.google.com/document/d/13F6GO_e3fENr6bYeQux29UXtqi7mdO8z0uJELuAZY3Y/edit?pli=1&tab=t.ejcfcjau18wn)

[Mechanical Advantage (6328) Presentation](https://www.youtube.com/watch?v=8FfwFQcvRmU)

[WPILib Simulation](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/introduction.html)
3 changes: 0 additions & 3 deletions docs/tutorials/circuit-python-tutorial.md

This file was deleted.

8 changes: 8 additions & 0 deletions docs/tutorials/circuit-python-tutorial/_category.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Circuit Playground Tutorial",
"position": 3,
"link": {
"type": "generated-index",
"description": "How to use Circuit Playgrounds with Python... Not very useful because we use Java with the Circuit Playgrounds now. "
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/tutorials/circuit-python-tutorial/circuit-python-advanced.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
sidebar_position: 5
---
# Circuit Python: Advanced
This is a page for those that feel comfortable with the code that was on the other pages. If you don't feel comfortable with that stuff yet, I would suggest you head back and experiment. Think of something you could do with the neopixels and play with the code.

## Next steps
Ok, there are no solutions on this page. You now know the basic building blocks, and it is time to write more code based on a suggestion. So here is a list of ideas. You don't need to do them in order either. Feels free to use Google, or the Adfruit learning guides, or the circuit python documentation. If you need help, look back at other examples we already did. Ask a team mate. If you are really stuck, ask a mentor.

* Play 2 different tones when pressing the two different buttons.
* * Did you play a tone for a specific time? Or turn it off when you let go of the button?
* * Did you create a function that played the tone? Did you need to?
* Play a different tone for every one of the touch pads.
* Store several notes in an list, and use a loop to play all of them.
* * If you need some help with a list of playing a song, you can try [here.](https://learn.adafruit.com/basic-datastructures-in-circuitpython/overview) However, the examples of playing notes are not the same on the Circuit Playground Express. You will also have to look up how to play a tone.
* Listen for a noise, and play a tone or turn on a pixel if the noise is too loud.
* Measure the temperature. Hold your finger on the temp sensor to see the changes.
* * Print the current temperature to the console.
* * Show the temperature by changing the colors of the pixels.
* * * You can show set temperature ranges, or a continuous change of colors.
* * Create a round thermometer showing cold to hot by number of pixels shown.
* Measure the light level. Cover the sensor with your hand to see the changes.
* Print the current level to the console.
* * Play a tone based on the light level
* * * Show less pixels on if the light is low, more if it is bright
* Use the accelerometer.
* * Change the tone played depending on the angle of the board left to right.
* * Change the pixel displayed based on the angle of the board in both left to right and forward and back.
* Use the neopixel library to control an external set of neopixels
* * Set the color for the whole string
* * Change the color for each pixel
* * Create a 'moving' animation
* Control a servo connected to the device
* * Have it turn forward with button_a, and backward with button_b
* * Have it move to different positions based on the touch pad pressed
* Create the game of Simon.
* * The board will show random lights, the user will then need to touch the right touch pads to continue
* * Can you make the game get harder by increasing the speed or number of lights shown?


## Sources
[GitHub Origin](https://github.com/2491-NoMythic/circuitPython/wiki/5.Advanced)
25 changes: 25 additions & 0 deletions docs/tutorials/circuit-python-tutorial/circuit-python-hardware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
sidebar_position: 2
---

# Circuit Python: Hardware
Our devices is the [Circuit Playground Express.](https://www.adafruit.com/category/965)

![playground_lights](./_img/playground_lights.jpg)
*A Circuit Playground with Activated Lights*

This is a really cool little device. It has a lot built in. There are neopixels (RGB lights) arranged in a ring. Around the outside of that are touch sensors. There is a buzzer, a microphone, 2 physical buttons, a switch, and an accelerometer (detects motion). There is a lot to play with here, but programming it is not an insurmountable challenge. Adafruit has made programming it very accessible, hence our use as an intro tool.

These boards can be programmed in many different ways. We will be using Circuit Python, but you can use Arduino, and even MakeCode. See the below links for more on those things.

To make these different environments work, there is a boot loader. If the board doesn't seem to work, try updating that. There is a process for this that is defined [here.](https://learn.adafruit.com/adafruit-circuit-playground-express/updating-the-bootloader)

There is lots to read up on if you want, but head right to Getting Started if you want to skip the details.

To dive deeper, check out [this page](https://learn.adafruit.com/adafruit-circuit-playground-express)
If you are curious about the ecosystem, see this [hardware overview page](https://www.adafruit.com/category/965).



## Sources
[GitHub Origin](https://github.com/2491-NoMythic/circuitPython/wiki/2.Hardware)
17 changes: 17 additions & 0 deletions docs/tutorials/circuit-python-tutorial/circuit-python-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Circuit Python: Intro
Welcome to the CircuitPython wiki!

We will be using CircuitPython, and the Circuit Playground Express from Adafruit to learn the basics of programming.

Start by getting more information on the hardware device, on the hardware page.

Then start to learn about programming on the Circuit Playground, see the programming page.

After getting things set up, we will learn programming step-by-step

![circuit_playground](./_img/circuit_playground.png)
*A Circuit Playground*


## Sources
[GitHub Origin](https://github.com/2491-NoMythic/circuitPython/wiki/1.Home)
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
sidebar_position: 3
---

# Circuit Python: Getting Started
We will be programming in Circuit Python. These devices can be programmed in MakeCode with blocks or Javascript, or using the Arduino IDE even. Here, we will use Circuit Python, which is a subset of Python. A lot of what you can do in Python you can also do in Circuit Python, but a few things needed to change in order to fit onto the tiny bit of memory these devices have.

## Getting Started
There are a couple of conventions we need to follow to make everything work. First, CircuitPython needs to be installed. If you are getting a board from the Robotics Team, then we have done this for you. Otherwise look [here.](https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart)

After the install when you plug in the device, you should get a removable device that shows up called CIRCUITPY. This works just like a removable drive does. The really neat thing is that you can drag and drop files to the device. In fact, that is how you get your code to it!

The Adafruit docs will all refer to the the Mu editor. Any program that can edit and save text files can be used. The way to make sure your program is read by the device is to use the code.py file name. If you save a file to the device called `code.py`, it will reboot and start to run that python program. It is often best to just open the existing `code.py` file on the device so a save will automatically save back to the device.

## Libraries
What can we do? Can we turn on a neopixel in our first program? Yes and no. Our first program will be to turn on a neopixel, but first we need to get a library to access the hardware. We installed Circuit Python, so we have the basic language installed. We can do some math, we can do loops and make decisions, but the basic Circuit Python install doesn't know how to access the hardware. We need a library for that. A library is some code that someone else has written that knows how to interact with something else, often some hardware. Just like how physical books have information on specific topics, or how Neo downloaded how to do Kung-Fu in the matrix, we will get a library to help us. We will use CPX. More on that library and the things it can do [here.](https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express)

When you plugged in your Circuit Playground Express and opened the CIRCUITPY drive you might have noticed a couple of things already there. There was probably a `code.py` file and an empty `lib` folder. This `lib` folder is where we will put any libraries that we need to use. We need to get them first though. You can download libraries at [circuitpython.org](https://circuitpython.org/libraries) The Circuit Python version and the version of the library needs to be the same version.

All of the libraries available will not fit onto our device. There isn't enough room. You will need to copy files into the lib folder if you want to use them. Fortunately, there is one special library already installed. We just need to use it. With it we can access the basic parts of the hardware.
```python
from adafruit_circuitplayground import cp
```
Now we can use the "cp" library in our program.

## First Program
Let's start with the Hello World of hardware devices: a blinky LED.
```python
from adafruit_circuitplayground import cp

while True:
cp.red_led = True
```
Let's look at each line of our first program.
We have already looked at the import. Any library we want to use will have a similar statement. We called this `import cp`.
The `while True:` is part of standard python. This sets up a never ending loop. "While the condition is still true, keep repeating the code after the colon." `True` and `False` are called booleans, and can represent on/off or positive/negative or yes/no.
The next line has spaces, or a tab. This is important in python. This is how blocks of code are defined. In our case, this is the block that will keep repeating forever. We just have one line here. It uses the `cp` library to access the red led on the board. Setting it to `True` will turn it on. Setting to `False` would turn it off.

Now save that code to the `code.py` file on the device.

That's it. You did it. You made a program run on a piece of hardware.

## Next Steps
Now, we need to learn about what other hardware we can use, and we need to learn a bit more Python along the way.

In the next part of this tutorial, I explain how to build a simple program step by step. I suggest you start there and work your way through.

But if you just want to see some basic code using the hardware, then check out the examples [here.](https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/circuit-playground-express-library)

You could jump into learning more about the [hardware.](https://learn.adafruit.com/circuitpython-essentials/circuitpython-essentials)

Just want the [documentation](https://docs.circuitpython.org/en/latest/README.html) for Circuit Python?

Want to dig into ready to run example code? Look at the library folder you downloaded. Inside each library is example code that you can copy over to your Circuit Playground device.


## Sources
[GitHub Origin](https://github.com/2491-NoMythic/circuitPython/wiki/3.Programming-(Getting-Started))
Loading