This project is a combination of three projects.
- A 3D Printed Ball with a simple circuit controlled by Arduino
- An arduino sketch with a custom RGB LED Library
- A Rocket League Plugin that tracks when a goal is scored
The list:
- 5 Common anode RGB Leds
- 6 150 ohm ressitors
- 3 100 ohm resistors
- Jumper Wire
- Wemos D1 Mini (or clone)
- Something to solder it to, I used Proto board
The circuit is simple enough, here are a couple of schematics explaining it.
Now that you made it through the MS Paint art show, we can continue with the software.
If you don't already have it, download the Arduino IDE: here
There is some extra setup needed with the the arduino IDE to make it build on an ESP8266 and our D1 Mini.
-
Copy the RGBLed folder into the libraries location for the Arduino IDE. For me it was here:
C:\Users\<USERNAME>\Documents\Arduino\libraries
This allows us to use the custom library in the sketch. -
To work with the esp8266, we need the IDE to recognise the board. In File->Preferences, Where it says Additional Boards Manager URLs, add this URL which includes the necessary info for the esp826:
https://arduino.esp8266.com/stable/package_esp8266com_index.json
With that taken care of, we should be able to go about editing and loading the sketch to the board. But first, I want to talk about what the code is doing.
There are really just two things happening.
- Modify the two #defines so that the arduino can connect to your wifi.
#define STASSID "WIFI-NAME" #define STAPSK "WIFI-PASSWORD"
- Under Tools->Board, change it to LONLIN(WEMOS) D1 R2 & mini
- Select the right port under Tools->Port, you may only have one option.
- With the setup done, you should be able to write the code to the board. Press the Arrow in the top left to compile and write the sketch to the board.
Some common issues might be theat the path isn't found for the library or the other headers. Just make sure you followed the previous steps. If there is another issue, reach out to me or tag an issue in the repo. Just make sure to be plugged into the computer when making major changes, because if you break the OTA feature, you have to plugin.
Once the code is loaded, the arduino should be ready to go. The ball should be glowing, and connected to WIFI. If not, Make sure the WIFI and password are correct. There should also be a valid webpage to navigate to from your computer. You will have to find what the IP address is, or you can set it manually in the arduino sketch. I used my Router, so I didn't worry about it.
Now that it's loaded, let's talk about how it works. The links on the page are received by the arduino and it makes the lights work. I used the simple URL method, so just GET calls will help us accomplish what we want. This could change in the future for more effects.
Use the webpage to
The plugin is a dll that will get loaded into Rocket league by Bakkesmod.
First, you need Bakkesmod
Then, you need the BakkesModSDK. It should be included in the bakkesmod files already. The linked version, should however, be more up to date.
I will admit, I haven't put as much time into the plugin part, which, ironically will be the most powerful going forward to integrate into other systems. But with the included project, building and deploying shouldn't be too bad.
- Update the IP address in RLBall.cpp to match your arduino. It should be on line 39 and 53, but could move.
- The file bakkes_patchplugin.py in the BakkesModSDK folder, for me it is here:
("C:\Program Files (x86)\Steam\steamapps\common\rocketleague\Binaries\Win64\bakkesmod\bakkesmodsdk\")
Change line 13 to your bakkesmod plugin folder. I included the file in the repo, but it is really a one line change. - Set the build type to Release and x64.
- Build the Solution. There is a post-build event to send the updated plugin to the plugin folder. If it all builds successfully, it should automatically load when Rocket league is launched or it will reload if Rocket league is already running.
Jump in a custom online game and try it out. F6 opens the console
To check and make sure the plugin is loaded, use the console and run plugin list
. If RLBall is not in the list, run plugin load rlball
. This will force the game to load the plugin.