-
Notifications
You must be signed in to change notification settings - Fork 84
The CONFIG_TOP section
The CONFIG_TOP section is primarily used to set up defines which enable and disable features in the code. However, it is also used to include a board specific config file. Let's start with the required parts:
First, we must include a board config file, basically, we have to pick one of these lines:
#include "v1_config.h" // TeensySaber V1
#include "v2_config.h" // TeensySaber V2
#include "v3_config.h" // TeensySaber V3
#include "proffieboard_v1_config.h" // Proffieboard V1
#include "proffieboard_v2_config.h" // Proffieboard V2
Next we must defines how many blades there are. Note that accent leds, crystal chambers and light-up buttons also counts as blades.
#define NUM_BLADES 1
And we must also specify how many buttons we have. Note that this is just used to change how some of the buttons behave, and nothing will actually break if you specify a number different from your actual number of buttons.
#define NUM_BUTTONS 2
Then we specify the volumes. Generally values between 0 and 3000 are useful, but it may depend on what kind of board you have.
#define VOLUME 1000
I don't remember why, but this next number is a constant instead of a define. It specifies how many pixels we can have in a single strip. Note that if you use RGBW pixels, this number needs to be 25% bigger than your actual number of pixels. There is no need to make this smaller if your strips are not 144 pixels long, but you do need to make it bigger if they are more than 144 pixels long.
const unsigned int maxLedsPerStrip = 144;
Next, we have the clash threshold. When two consecutive accelerometer readings differ by this much, a clash is triggered. The unit is in Gs. (About 9.81 newtons.) Larger values will make clashes harder to trigger, smaller values will make clashes easier to trigger.
#define CLASH_THRESHOLD_G 1.0
Finally, we have a set of defines that enable standard features. It's on my TODO list to make these not required:
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
There are also some OPTIONAL defines that can be added to this section:
This define enables the OLED display code.
#define ENABLE_SSD1306
This code makes it possible to use the same power pins for multiple blades. Note that this is currently EXPERIMENTAL code and may not work properly.
#define SHARED_POWER_PINS
If your board is installed in a different orientation than normal, you may need to add one of the following lines to make ProffieOS behave properly:
#define ORIENTATION ORIENTATION_NORMAL
#define ORIENTATION ORIENTATION_FETS_TOWARDS_BLADE
#define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
#define ORIENTATION ORIENTATION_SDA_TOWARDS_BLADE
#define ORIENTATION ORIENTATION_SERIAL_TOWARDS_BLADE
#define ORIENTATION ORIENTATION_TOP_TOWARDS_BLADE
#define ORIENTATION ORIENTATION_BOTTOM_TOWARDS_BLADE
Note that SERIAL/SDA towards blade was meant for TeensySabers, so I really should make up new names for them. // Dual power buttons
means that clicking AUX will also turn the saber on. // If not defined, AUX will go to next preset when off.
#define DUAL_POWER_BUTTONS
// Must be 20 characters or less.
#define BLE_PASSWORD "password"
#define ENABLE_SERIAL
#define ENABLE_SERIALFLASH
#define ENABLE_FASTLED
#define ENABLE_DEVELOPER_COMMANDS
#define BLE_NAME
#define BLE_SHORTNAME
Cool Footer