3.4 KiB
Writing Apps
Here's a the example app that should show the calls for most of the things you might want to do
You can do literally anything the Jumperless can in an app, so if there's a specific thing, lmk and I'll write an example. Until I make this into a proper operating system, what you're doing when you write an App is just writing a function in the main firmware. There's really no guard rails, and the API is just any function in the firmware.
First get it PlatformIO set up to flash code
So fork the firmware here: https://github.com/Architeuthis-Flux/JumperlessV5
I'm using PlatformIO in VSCode. And it should just work to open the RP23V50firmware folder in that (you'll probably need to comment out upload_port = /dev/cu.usbmodem101
in Platformio.ini
so it'll just automatically find it)
You should just open the RP23V50firmware
folder, not the entire JumperlessV5
repo, in VSCode.
You should probably try to just load the firmware just to make sure everything works.
To write an App
Before you go writing your app, follow these steps to make it so it's listed in the App library and you can run it from the menus.
-
Go to
menuTree.h
and add the name of your app underApps\n\
(shown as-Custom App\n\
here, it needs to fit in 7x2 chars to show on the breadboard) -
Go to
Apps.h
and declare your function where you'll write your app -
Go to
Apps.cpp
and add a struct in thestruct app apps[30]
for your app{"Name", index, ??idk, name of the function (unused)}
-
Go to
Apps.cpp > runApp()
and add acase
for your app's index (this is so you can also find it by index rather than exact matching the name"Custom App"
-
Make a function that's the entirety of your app, I just pushed a demo function called
customApp(void)
with some (non exhaustive) examples of things you can do from an app. -
Run your app with the clickwheel,
Apps > Custom App
.
The quick way run "Custom App"
is to just enter 2
in the main menu, or just use the clickwheel and go Apps > Custom App.
If you want to add your own shortcut, find an unused menu character and add a
case'3':
{
runApp(3); //the app index you set above
break;
}
in the big main menu switch
statement in main.cpp
.
To actually write the app
The code for Custom App
is an example of the calls available with comments telling you what's going on. There are tons more, but what's shown there are the higher-level helper functions that should roughly do what they say they're doing.