### Example Configuration for FETT263 Buttons Source: https://github.com/profezzorn/proffieos/wiki/ProffieOS5.x-saber_fett263_buttons.h-"Battle-Mode"-and-Gesture-Controls,-Defines-and-Usage An example of how to include the FETT263 button prop file and define various controls in the config.h file. ```cpp #ifdef CONFIG_TOP #include "proffieboard_v2_config.h" #define NUM_BLADES 1 #define NUM_BUTTONS 2 #define VOLUME 1500 const unsigned int maxLedsPerStrip = 144; #define CLASH_THRESHOLD_G 2.0 #define ENABLE_AUDIO #define ENABLE_MOTION #define ENABLE_WS2811 #define ENABLE_SD #define COLOR_CHANGE_DIRECT #define DISABLE_DIAGNOSTIC_COMMANDS **#define FETT263_THRUST_ON** // enables Thrust On Ignition **#define FETT263_SWING_ON** // enables Swing On Ignition **#define FETT263_TWIST_ON** // enables Twist On Ignition **#define FETT263_TWIST_OFF** // enables Twist Off Retraction **#define FETT263_FORCE_PUSH** // enables Force Push gesture/sound during Battle Mode **#define MOTION_TIMEOUT 60 * 15 * 1000** // keeps motion chip active for 15 minutes while blade is Off **#define FETT263_MULTI_PHASE** // enables Multi-Phase preset changing while blade is ON #endif **#ifdef CONFIG_PROP** **#include "../props/saber_fett263_buttons.h"** **#endif** #ifdef CONFIG_PRESETS Preset presets[] = {... ``` -------------------------------- ### Install USB Serial Driver (Windows 7/XP) Source: https://github.com/profezzorn/proffieos/wiki/ProffieBoard-Setup Manually install the unsigned USB serial driver for Proffieboard on Windows 7/XP. Run the appropriate dpinst executable as administrator and confirm the installation. ```batch dpinst_x86.exe ``` ```batch dpinst_amd64.exe ``` -------------------------------- ### WebUSB Access URLs and Driver Installation Source: https://context7.com/profezzorn/proffieos/llms.txt Provides URLs for accessing the ProffieOS Workbench via WebUSB and instructions for installing the necessary driver on Windows 7 using Zadig. ```text # WebUSB access URLs: # Wired USB: https://profezzorn.github.io/lightsaber-web-bluetooth/app.html # (connect via "USB" button in the Workbench) # BLE: same URL, connect via Bluetooth # iOS: use WebBLE app (https://apps.apple.com/us/app/webble/id1193531073) # Windows 7 only — install WebUSB driver via Zadig: # 1. Run Zadig → Options → List All Devices # 2. Select "CDC Data (interface 2)", verify USB ID: 1209 6668 02 # 3. Install WinUSB (v6.1.7600.16385) as new driver ``` -------------------------------- ### ProffieOS Configuration Example Source: https://context7.com/profezzorn/proffieos/llms.txt This is a comprehensive example of a ProffieOS configuration file. It demonstrates how to include board-specific configurations, define the number of blades and buttons, set volume, LED strip parameters, enable features like audio and motion, and configure presets and buttons. ```cpp // my_saber_config.h #ifdef CONFIG_TOP #include "proffieboard_v2_config.h" // board: Proffieboard V2 #define NUM_BLADES 1 #define NUM_BUTTONS 2 #define VOLUME 1500 const unsigned int maxLedsPerStrip = 144; #define CLASH_THRESHOLD_G 1.0 #define ENABLE_AUDIO #define ENABLE_MOTION #define ENABLE_WS2811 #define ENABLE_SD #define SAVE_STATE // saves preset, volume, color change #define DYNAMIC_BLADE_DIMMING // controllable from Workbench #define DYNAMIC_CLASH_THRESHOLD #define NO_REPEAT_RANDOM // avoid repeating same sound effect #endif #ifdef CONFIG_PROP #include "../props/saber_fett263_buttons.h" // optional custom prop file #endif #ifdef CONFIG_PRESETS Preset presets[] = { { "SmthJedi", "tracks/mars.wav", StylePtr, WHITE>, WHITE>, 300, 800>>(), "Blue Jedi" }, { "TeensySF", "tracks/venus.wav", StyleNormalPtr(), "Cyan Classic" }, }; BladeConfig blades[] = { { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS>(), CONFIGARRAY(presets) }, }; #endif #ifdef CONFIG_BUTTONS Button PowerButton(BUTTON_POWER, powerButtonPin, "pow"); Button AuxButton(BUTTON_AUX, auxPin, "aux"); #endif ``` -------------------------------- ### Basic Style Template Examples by Type Source: https://github.com/profezzorn/proffieos/wiki/Blade-Styles Provides examples of basic style templates for different argument types: COLOR, INTEGER, FUNCTION, and TRANSITION. ```BladeStyle Rgb<255,0,0> // COLOR (red in this case), takes three INTEGERs as arguments ``` ```BladeStyle 10 // INTEGER ``` ```BladeStyle Int<10> // FUNCTION (this function always returns 10) ``` ```BladeStyle TrFade<100> // TRANSITION (fade from one color to next in 100ms) ``` ```BladeStyle Rainbow // COLOR (always changing) ``` -------------------------------- ### Example Responsive Styles Implementation Source: https://github.com/profezzorn/proffieos/wiki/Responsive-Styles-&-Effects This example demonstrates how to implement a set of responsive styles within a Layers<> structure. It includes common responsive effects like Clash, Blast, Stab, Lockup, Drag, LightningBlock, and Melt, with defaults for easy integration. ```cpp StylePtr, ResponsiveBlastL< COLOR >, ResponsiveStabL< COLOR >, ResponsiveLockupL< COLOR >, ResponsiveDragL< COLOR >, ResponsiveLightningBlockL< COLOR >, ResponsiveMeltL< > >, OUT_MILLIS, IN_MILLIS, OFF_COLOR>>() ``` -------------------------------- ### ProffieBoard Setup via Arduino IDE Source: https://context7.com/profezzorn/proffieos/llms.txt Outlines the process of programming the ProffieOS using the Arduino IDE and the official Proffieboard plugin, with firmware flashing over USB. ```text ProffieOS is programmed through the Arduino IDE with the official Proffieboard plugin, flashing firmware over USB using the STM32 DFU bootloader. ``` -------------------------------- ### Setup udev Rules for Linux Source: https://github.com/profezzorn/proffieos/wiki/ProffieBoard-Setup Copy the provided rules file to /etc/udev/rules.d to ensure proper device recognition on Linux systems. A reboot is required after copying the file. ```bash sudo cp *.rules /etc/udev/rules.d ``` -------------------------------- ### Enable Save Preset Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Configure the saber to start at the last used preset when powered on. ```cpp #define SAVE_PRESET ``` -------------------------------- ### Templated LED Configuration Example Source: https://github.com/profezzorn/proffieos/wiki/LED-configuration Use templated LED configuration structs from blades/leds.h to define specific LED types with custom resistor values. This example shows how to specify a CREE XP-E2 amber LED with a 0.24 ohm resistor. ```cpp CreeXPE2PCAmberTemplate<240> ``` -------------------------------- ### Enable Save Volume Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Configure the saber to start with the last used volume setting. ```cpp #define SAVE_VOLUME ``` -------------------------------- ### ProffieOS Style: Standalone StylePOV<> Example Source: https://github.com/profezzorn/proffieos/blob/master/pov_tools/readme.md This example shows how to use StylePOV<> as a stand-alone style in a ProffieOS preset. The StylePOV<> template can accept a REPEAT argument to create multiple instances of the image within the swing window. ```c++ { "Font", "tracks/track.wav", StylePtr>(), "my_pov" } ``` -------------------------------- ### Install STM32 BOOTLOADER Driver (Windows) Source: https://github.com/profezzorn/proffieos/wiki/ProffieBoard-Setup Install the WinUSB driver for the STM32 BOOTLOADER device using Zadig. Verify the USB ID is 0483:df11 before proceeding. This is crucial for Windows 7/XP. ```bash WinUSB (v6.1.7600.16385) ``` -------------------------------- ### Preset with two blade styles Source: https://github.com/profezzorn/proffieos/wiki/Error-messages-in-Arduino-and-how-to-decipher-them. Example of a preset configuration with two blade styles, used to illustrate common errors. ```cpp 17 { "JediFont", "tracks/GoodGuys.wav", 18 StylePtr>(), 19 StylePtr>(), 20 "jedi" }, ``` -------------------------------- ### SD Card Sound Font Layout Example Source: https://context7.com/profezzorn/proffieos/llms.txt Organize sound font files on the SD card using numbered .wav files. ProffieOS auto-detects monophonic/polyphonic and SmoothSwing versions based on filenames. ```text SD Card layout example: /SmthJedi/ hum.wav hum1.wav out.wav in.wav clsh01.wav clsh02.wav clsh03.wav lock01.wav blst01.wav swingl01.wav swingh01.wav font.wav boot.wav preon.wav pstoff.wav smoothsw.ini /tracks/ mars.wav ``` ```text # Multi-directory font search path (OS4+): # In preset: "hero/font;hero/obiwan;common" # ProffieOS searches directories in order, first-found wins per effect name. ``` ```text # Alternative file organization (OS supports both): /SmthJedi/clsh/001.wav /SmthJedi/clsh/clsh001.wav ``` -------------------------------- ### Arduino IDE Error Message Example Source: https://github.com/profezzorn/proffieos/wiki/It-doesn't-compile-and-I-don't-know-why This example shows a typical Arduino IDE error message, highlighting the line number and the specific error encountered. Use this to locate the problem in your configuration file. ```c++ In file included from /HardDrive/Lightsabers/ProffieOS/ProffieOS.ino:631:0: /HardDrive/Lightsabers/ProffieOS/config/mysaber_config.h:47:5: error: expected '}' before 'StyleNormalPtr' StyleNormalPtr(), "white"}; ^ ``` -------------------------------- ### Font Configuration for Track Player Source: https://github.com/profezzorn/proffieos/wiki/ProffieOS6-Fett263-Track-Player Example of how to configure a font with the Track Player capability. Ensure the 'common' folder is present on the SD card with voice prompts. ```c++ { "font;common", "font/tracks/trackname.wav", StylePtr<...>( ), "preset name" }, ``` -------------------------------- ### Applying DimBlade to a Blade Configuration Source: https://github.com/profezzorn/proffieos/wiki/DimBlade This example shows how to integrate DimBlade into your existing blade configuration array to reduce the blade's brightness to 50%. ```cpp BladeConfig blades[] = { { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS >(), CONFIGARRAY(presets) }, }; ``` ```cpp BladeConfig blades[] = { { 0, DimBlade(50.0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS >()), CONFIGARRAY(presets) }, }; ``` -------------------------------- ### PQoiml Battery Overlay Example Source: https://github.com/profezzorn/proffieos/blob/master/pqoi/readme.md This pqoiml script defines a battery overlay. It uses image processing commands to scale and flip images, sets a frame rate, and employs conditional logic to display different image files based on the battery level 'A'. ```pqoiml scaling pamcut -pad 0 0 174 250 | pamflip -r180 | pamcut -pad 0 0 1280 640 | pamflip -r180 | pamscale -xysize 160 80 fps 1:2 label empty file 0.png label twenty file 20.png if A<10 goto blink if A<40 goto twenty label forty file 40.png if A<40 goto twenty if A<60 goto forty label sixty file 60.png if A<60 goto forty if A<80 goto sixty label eighty file 80.png if A<80 goto sixty label full if A<90 goto eighty file 100.png goto full ``` -------------------------------- ### Proffieboard Upload Progress Indicator Source: https://github.com/profezzorn/proffieos/wiki/Is-it-uploading? This is an example of the progress output seen during a Proffieboard upload. It shows the download status, percentage complete, and bytes transferred. ```text Download [======= ] 30% 123128 bytes ``` -------------------------------- ### Blade Configuration with Multiple Blades Source: https://github.com/profezzorn/proffieos/wiki/Blade-ID Example of a BladesConfig array with different Blade IDs and corresponding blade configurations. Ensure the Blade ID values are measured and configured accurately for each blade. ```cpp BladesConfig blades[] = { { 5000, WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS >(), CONFIGARRAY(blade1_in) }, { 10000, WS281XBladePtr<128, bladePin, Color8::GRB, PowerPINS >(), CONFIGARRAY(blade2_in) }, }, { NO_BLADE, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS >(), CONFIGARRAY(no_blade) }, } }; ``` -------------------------------- ### Blade Configuration with Custom LED Structs Source: https://github.com/profezzorn/proffieos/wiki/LED-configuration Configure the blade array using custom LED structs, including those defined with the SUBTRACT directive. This example sets up a blade with Red, Blue, Green, and White LEDs, specifying power pins and configuration arrays. ```cpp BladeConfig blades[] = { { 0, SimpleBladePtr(), CONFIGARRAY(presets) } }; ``` -------------------------------- ### Example BladesConfig using Blade Detect Source: https://github.com/profezzorn/proffieos/wiki/Blade-Detect This configuration defines two blade presets: one for when a blade is present and another for when no blade is detected (NO_BLADE). The 'nbsave' option in the no-blade configuration specifies a directory for saving presets. ```cpp BladesConfig blades[] = { { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS >(), CONFIGARRAY(blade_in) }, { NO_BLADE, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS >(), CONFIGARRAY(no_blade), "nbsave" } }; ``` -------------------------------- ### Percentage<> with WavLen<> in TrConcat Source: https://github.com/profezzorn/proffieos/wiki/WavLen Utilize Percentage<> around WavLen<> to control transition durations proportionally to the WAV file length within a TrConcat sequence. This example sets each fade to 50% of the sound duration. ```cpp TransitionEffectL,BrownNoiseFlicker,500>,TrFade<1000>>,EFFECT_FORCE> ``` ```cpp TransitionEffectL,50>>,BrownNoiseFlicker,500>,TrFadeX,50>>>,EFFECT_FORCE> ``` -------------------------------- ### Complex Nested Blade Style Example Source: https://github.com/profezzorn/proffieos/wiki/Blade-Styles A detailed example of a complex blade style, showing nested templates for effects like Blast, AudioFlicker, Lockup, SimpleClash, and InOutHelper. ```BladeStyle StylePtr,AudioFlicker>,White>, 300, 800>() ``` -------------------------------- ### Example of Nested Style Punctuation Error Source: https://github.com/profezzorn/proffieos/wiki/It-doesn't-compile-and-I-don't-know-why This example demonstrates a subtle punctuation error within nested styles. Ensure all opening '<' and closing '>' characters are correctly paired, especially in complex style definitions. ```c++ AudioFlicker> ``` -------------------------------- ### Syntax Expansion for WavLen<> Source: https://github.com/profezzorn/proffieos/wiki/WavLen Demonstrates the expanded syntax required for WavLen<>. Transitions like TrFade<500> must be converted to TrFadeX> to accept WavLen<> as an integer argument. ```cpp TrFade<500> ``` ```cpp TrFadeX> ``` -------------------------------- ### Create PQOI file from image Source: https://github.com/profezzorn/proffieos/blob/master/pqoi/readme.md Use `cpqoi` to convert an image to the PQOI format. The output resolution matches the input. A scaling pipeline can be specified. ```bash ./cpqoi someimage.png >someimage.pqf ``` ```bash ./cpqoi someinage.png "pamscale -xysize 128 80" >someimage.pqf ``` -------------------------------- ### Define Multiple Blade Configurations Source: https://github.com/profezzorn/proffieos/wiki/Blade-Configuration Defines two blade configurations with different resistance values for selection. The first uses a 2.6k resistor for a neopixel setup, and the second uses a 13k resistor for a Tri-Cree setup. ```cpp BladeConfig blades[] = { {2600, WS2811BladePtr<144, WS2811_ACTUALLY_800kHz | WS2811_GRB>(), CONFIGARRAY(presets) }, {13000, SimpleBladePtr(), CONFIGARRAY(white_presets) }, }; ``` -------------------------------- ### Include Board Configuration - ProffieOS Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Select the appropriate configuration file for your Proffieboard version. Using 'proffieboard_config.h' allows for automatic version detection. ```cpp #include "v1_config.h" ``` ```cpp #include "v2_config.h" ``` ```cpp #include "v3_config.h" ``` ```cpp #include "proffieboard_v1_config.h" ``` ```cpp #include "proffieboard_v2_config.h" ``` ```cpp #include "proffieboard_config.h" ``` -------------------------------- ### Responsive Combat Style Configuration Source: https://context7.com/profezzorn/proffieos/llms.txt Implement a full responsive combat style by layering various motion-reactive effects. Ensure necessary imports for Layers and responsive effects. ```cpp StylePtr< InOutHelper< Layers< BLUE, ResponsiveClashL, ResponsiveBlastL, ResponsiveStabL, ResponsiveLockupL, ResponsiveDragL, ResponsiveLightningBlockL, ResponsiveMeltL<> >, 300, 800 > >() ``` -------------------------------- ### Include Hardware Configuration Headers Source: https://github.com/profezzorn/proffieos/wiki/Supported-Hardware Include the appropriate header file in your configuration to ensure your program runs on the specific hardware variant. These headers define the necessary configurations for each board. ```c++ #include "v1_config.h" ``` ```c++ #include "v2_config.h" ``` ```c++ #include "v3_config.h" ``` ```c++ #include "proffieboard_v1_config.h" ``` ```c++ #include "proffieboard_v2_config.h" ``` -------------------------------- ### Create animated PQOI file Source: https://github.com/profezzorn/proffieos/blob/master/pqoi/readme.md Create an animated and looped PQOI file from a movie using `cpqoi`. The animation is essentially concatenated PQF files with a frame rate header. A scaling pipeline can be applied. ```bash ./cpqoi somemovie.mp4 "pamscale -xysize 128 80" >animation.pqf ``` -------------------------------- ### Set Board Orientation - ProffieOS Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Configure the board's orientation to ensure ProffieOS behaves correctly based on installation. ```cpp #define ORIENTATION ORIENTATION_NORMAL ``` ```cpp #define ORIENTATION ORIENTATION_FETS_TOWARDS_BLADE ``` ```cpp #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE ``` ```cpp #define ORIENTATION ORIENTATION_SDA_TOWARDS_BLADE ``` ```cpp #define ORIENTATION ORIENTATION_SERIAL_TOWARDS_BLADE ``` ```cpp #define ORIENTATION ORIENTATION_TOP_TOWARDS_BLADE ``` ```cpp #define ORIENTATION ORIENTATION_BOTTOM_TOWARDS_BLADE ``` -------------------------------- ### PQOIML file import command Source: https://github.com/profezzorn/proffieos/blob/master/pqoi/readme.md Imports an image or movie into the PQF file using the specified scaling pipeline. ```plaintext file FILENAME ``` -------------------------------- ### Typical ProffieOS Configuration File Structure Source: https://github.com/profezzorn/proffieos/wiki/The-config-file This snippet shows the general structure of a ProffieOS configuration file, including the common sections for top-level settings, presets, and button configurations. Ensure correct inclusion of headers and definition of constants. ```cpp #ifdef CONFIG_TOP #include "proffieboard_v1_config.h" #define NUM_BLADES 1 #define NUM_BUTTONS 2 #define VOLUME 1000 const unsigned int maxLedsPerStrip = 144; #define CLASH_THRESHOLD_G 1.0 #define ENABLE_AUDIO #define ENABLE_MOTION #define ENABLE_WS2811 #define ENABLE_SD #endif #ifdef CONFIG_PRESETS Preset presets[] = { { "TeensySF", "tracks/venus.wav", StyleNormalPtr(), "cyan"}, { "SmthJedi", "tracks/mars.wav", StylePtr >(), "blue"}, { "TthCrstl", "tracks/mars.wav", StylePtr, WHITE), 300, 800> >(), "green"}, { "TthCrstl", "tracks/uranus.wav", StyleStrobePtr(), "strobe"}, { "TeensySF", "tracks/venus.wav", &style_pov, "POV"}, { "SmthJedi", "tracks/mars.wav", &style_charging, "Battery\nLevel"} }; BladeConfig blades[] = { { 0, WS2811BladePtr<144, WS2811_ACTUALLY_800kHz | WS2811_GRB>(), CONFIGARRAY(presets) }, }; #endif #ifdef CONFIG_BUTTONS Button PowerButton(BUTTON_POWER, powerButtonPin, "pow"); Button AuxButton(BUTTON_AUX, auxPin, "aux"); #endif ``` -------------------------------- ### Define BLADE_DETECT_PIN with a numeric value Source: https://github.com/profezzorn/proffieos/wiki/Blade-Detect This example shows how to define the blade detection pin using a direct numeric value. ```cpp #define BLADE_DETECT_PIN 0 ``` -------------------------------- ### Define BLADE_DETECT_PIN with a symbolic name Source: https://github.com/profezzorn/proffieos/wiki/Blade-Detect This example demonstrates defining the blade detection pin using a symbolic name, which can be more readable and maintainable. ```cpp #define BLADE_DETECT_PIN blade4Pin ``` -------------------------------- ### Basic Style Template Usage Source: https://github.com/profezzorn/proffieos/wiki/Blade-Styles Demonstrates the syntax for using a style template with arguments. Note the use of angle brackets and commas between arguments. ```BladeStyle StyleTemplateName ``` -------------------------------- ### SimpleClash Template Example Source: https://github.com/profezzorn/proffieos/wiki/Blade-Styles Demonstrates how to specify custom clash duration for a blade style using the SimpleClash template. The default duration is 40 milliseconds. ```cpp SimpleClash ``` -------------------------------- ### Configure Proffieboard Features and Settings Source: https://context7.com/profezzorn/proffieos/llms.txt Use this section to include your board configuration and define essential features like audio, motion, and LED support. Configure blade and button counts, volume, and other hardware-specific settings. Optional defines enable advanced features such as OLED displays, dual power buttons, and BLE connectivity. ```cpp #ifdef CONFIG_TOP // --- Required board include (pick one) --- #include "proffieboard_v1_config.h" // Proffieboard V1 #include "proffieboard_v2_config.h" // Proffieboard V2 // #include "proffieboard_config.h" // auto-detects board version // #include "v3_config.h" // TeensySaber V3 #define NUM_BLADES 2 // main blade + accent LED = 2 blades #define NUM_BUTTONS 2 #define VOLUME 1000 // 0–3000 const unsigned int maxLedsPerStrip = 144; // increase if blade > 144 pixels #define CLASH_THRESHOLD_G 1.0 // lower = easier to trigger clash // --- Required feature flags --- #define ENABLE_AUDIO #define ENABLE_MOTION #define ENABLE_WS2811 #define ENABLE_SD // --- Save/restore state across power cycles --- #define SAVE_STATE // = SAVE_VOLUME + SAVE_PRESET + SAVE_COLOR_CHANGE // Or use the OS6 umbrella define: #define ENABLE_ALL_EDIT_OPTIONS // Which equals: DYNAMIC_BLADE_LENGTH + DYNAMIC_BLADE_DIMMING + // DYNAMIC_CLASH_THRESHOLD + SAVE_VOLUME + // SAVE_BLADE_DIMMING + SAVE_CLASH_THRESHOLD + SAVE_COLOR_CHANGE // --- OS6 dynamic controls --- #define DYNAMIC_BLADE_DIMMING #define DYNAMIC_BLADE_LENGTH #define DYNAMIC_CLASH_THRESHOLD #define SAVE_BLADE_DIMMING #define SAVE_CLASH_THRESHOLD // --- Board orientation (if not standard) --- #define ORIENTATION ORIENTATION_FETS_TOWARDS_BLADE // or for non-90-degree mounts: #define ORIENTATION_ROTATION 0,20,0 // X,Y,Z degrees // --- Optional features --- #define ENABLE_SSD1306 // OLED display #define OLED_FLIP_180 // rotate display #define DUAL_POWER_BUTTONS // AUX also turns saber on #define BLADE_DETECT_PIN bladePowerPin4 // detect blade presence #define KEEP_SAVEFILES_WHEN_PROGRAMMING // preserve .ini edits on re-flash #define NO_REPEAT_RANDOM // avoid repeating last-played sound #define FEMALE_TALKIE_VOICE // female voice for error messages #define DISABLE_BASIC_PARSER_STYLES // save memory (OS6+) #define FILTER_CUTOFF_FREQUENCY 100 // high-pass filter for speakers (Hz) #define FILTER_ORDER 8 // --- Blade ID with external pullup resistor --- #define BLADE_ID_CLASS ExternalPullupBladeID // Or bridged pin method: #define BLADE_ID_CLASS BridgedPullupBladeID // Power FETs during blade ID scan: #define ENABLE_POWER_FOR_ID PowerPINS // --- Audio outputs --- #define ENABLE_I2S_OUT #define ENABLE_SPDIF_OUT #define LINE_OUT_VOLUME 2000 // --- BLE Bluetooth --- #define ENABLE_SERIAL #define BLE_PASSWORD "mysaber" // max 20 chars #define BLE_NAME "MySaber" #define BLE_SHORTNAME "saber" // max 8 chars // --- RFID reader --- #define RFID_SERIAL Serial3 #endif ``` -------------------------------- ### SmoothSwing Configuration Parameters Source: https://github.com/profezzorn/proffieos/wiki/smoothsw.ini Configure SmoothSwing algorithm version, sensitivity, volume, and responsiveness. Ensure Version is set to 2 for optimal performance. ```ini # SmoothSwing algorithm version, you probably want to set this to 2. Version=2 # Degrees of rotations per second required to reach full volume. # Default is 450.0 (any value) SwingSensitivity=450 # Smoothswing volume multiplier (defaults to 3x normal volume) # Default is 3.0 (value between 1 and 5) MaxSwingVolume=3.0 # What percent the hum sound will decrease as swing increases # Default is 75.0 (value between 1 and 100) MaximumHumDucking=75 # Non-linear swing response (higher values make it more non-linear) # Values greater than 1 will result in the Smoothswing sound staying quieter # at lower speeds and then ramping up quickly to full volume a higher speeds. # Values less than 1 will result in the Smoothswing volume ramping up quickly # at lower speeds and then staying there as you approach full speed. # the default is 1.75 (any value) SwingSharpness=1.75 # Degrees per second needed to register as a smoothswing. # Default is 20.0 (1 to 360) SwingStrengthThreshold=20 # Length of first transition in degrees. # Default is 45.0 (1 to 360) Transition1Degrees=45 # Length of second transition in degrees. # Default is 160.0 (1 to 360) Transition2Degrees=160.0 # If not zero, swngNNN.wav or swngNNN.wav will # be played when we reach this swing speed. # Unit is degrees per second, 450 is a reasonable value. # Default is 0.0 AccentSwingSpeedThreshold=450 # If not zero AND accent swings are on, this defines the threshold for when # a swing is considered a slash. Unit is degrees per second **per second**. # NOTE - While 260 is the default value, it is subjective. # Something like 100 might work better. # The higher the accent swing threshold, the higher the slash threshold will need to be. AccentSlashAccelerationThreshold=260.0 # NOTES # 1. The length of the smoothswing pair wavs has nothing to do with # the length of the swing movement or how it transitions. # Try setting the SwingSensitivity number so that you're not # detecting motion for smaller movements. # 2. If you find that the same swing pair sounds play for subsequent swings, # try adjusting SwingSensitivity. If the saber is moving faster than the threshold velocity, # it is going to be playing one of the smoothswing pairs on loop. # The algorithm only picks a new swing pair of swingl and swingh sounds when it thinks # it's safe to do so (when you're not in the middle of a swing). ``` -------------------------------- ### Enable Standard Features - ProffieOS Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Enable core features for audio, motion sensing, WS2811 LEDs, and SD card support. ```cpp #define ENABLE_AUDIO ``` ```cpp #define ENABLE_MOTION ``` ```cpp #define ENABLE_WS2811 ``` ```cpp #define ENABLE_SD ``` -------------------------------- ### Set Idle Off Time for Accent LEDs Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Specify a timeout in milliseconds for accent LEDs that glow when the saber is off, to prevent battery drain. This example sets it to 10 minutes. ```cpp #define IDLE_OFF_TIME 60 * 10 * 1000 ``` -------------------------------- ### Select Prop File with CONFIG_PROP Source: https://context7.com/profezzorn/proffieos/llms.txt Choose a prop file to control button-action mappings, gestures, and OS behaviors. If omitted, the default `saber.h` is used. Ensure the selected prop is compatible with your ProffieOS version. ```cpp #ifdef CONFIG_PROP // Default saber prop (omitting CONFIG_PROP is equivalent): #include "../props/saber.h" // Community prop with battle mode and gesture controls (OS5+): #include "../props/saber_fett263_buttons.h" // Prop by Brian Conner with additional features (OS6+): #include "../props/saber_BC_buttons.h" // sa22c button layout: #include "../props/saber_sa22c_buttons.h" // Blaster prop: #include "../props/blaster.h" // Thermal detonator: #include "../props/detonator.h" // AudioFX board emulator: #include "../props/audiofx.h" // Custom prop: define your own class and set PROP_CLASS: // #define PROP_CLASS MyCustomProp // (define MyCustomProp in this section) #endif ``` -------------------------------- ### Example preset.ini block structure Source: https://github.com/profezzorn/proffieos/wiki/Editing-presets.ini-by-hand This block defines a single saber preset. It specifies the font, sound track, blade styles, preset name, and color variation. ```ini new_preset font=TFAFlex track=tracks/rey_training.wav style=builtin 0 1 style=builtin 0 2 name=Graflex8 variation=23299 ``` -------------------------------- ### Blade ID Configuration Options Source: https://context7.com/profezzorn/proffieos/llms.txt Defines different methods for hardware-based blade detection using resistor values. Choose the appropriate class based on your hardware setup. ```cpp // --- In CONFIG_TOP --- // Default (Proffieboard): charges internal capacitor, reads relative values // (values do NOT equal actual resistor ohms; must be measured empirically) // External pullup workaround (values match actual resistor ohms): #define BLADE_ID_CLASS ExternalPullupBladeID // Place 22k resistor between blade pin and 3.3V // Bridged TX pin workaround (Proffieboard V2.2): #define BLADE_ID_CLASS BridgedPullupBladeID // Bridge ID pin to TX pin (pin 9); cannot use TX for BLE // Power FETs during ID scan (required when neopixels are in series on data pin): #define ENABLE_POWER_FOR_ID PowerPINS ``` ```cpp // --- In CONFIG_PRESETS --- // First value in BladeConfig = target resistance in ohms BladeConfig blades[] = { { 5000, WS281XBladePtr<100, bladePin, Color8::GRB>(), CONFIGARRAY(blade1) }, { 10000, WS281XBladePtr<132, bladePin, Color8::GRB>(), CONFIGARRAY(blade2) }, { 33000, WS281XBladePtr<144, bladePin, Color8::GRB>(), CONFIGARRAY(blade3) }, { NO_BLADE, WS281XBladePtr<1, bladePin, Color8::GRB>(), CONFIGARRAY(no_blade) }, }; // Inline resistor (data signal protection): 150–470 ohms // Blade ID resistor (between data pin and GND in connector): 2k–100k ohms // These are two different resistors serving different purposes. // Trigger a re-scan at runtime via serial monitor: // > scanid ``` -------------------------------- ### Customized ResponsiveLockupL Source: https://context7.com/profezzorn/proffieos/llms.txt Customize ResponsiveLockupL with specific transitions, position limits, and size. Adjust TRANSITION1, TRANSITION2, TOP, BOTTOM, and SIZE parameters as needed. ```cpp ResponsiveLockupL< WHITE, TrFade<200>, TrFade<400>, Int<26000>, Int<6000>, Int<16384> > ``` -------------------------------- ### Save PQOIML to file Source: https://github.com/profezzorn/proffieos/blob/master/pqoi/readme.md Redirect the PQOIML output from `dpqoi` to a file for later use. ```bash ../dpqoi ../animation.pqf >animation.pqoiml ``` -------------------------------- ### Button Command with Click Type Shorthand Source: https://github.com/profezzorn/proffieos/wiki/Button-Commands Specify the type of click or hold event using shorthand characters. For example, 'pow L' triggers a long click event. ```c++ case EVENTID(BUTTON_POWER, EVENT_CLICK_LONG, MODE_OFF): case EVENTID(BUTTON_POWER, EVENT_CLICK_LONG, MODE_ON): ``` -------------------------------- ### Configure Dual Prop Files in Config Source: https://github.com/profezzorn/proffieos/wiki/Using-dual_prop.h. Include the dual_prop.h header along with the desired prop files and define PROP_TYPE to use two distinct prop configurations. ```cpp #ifdef CONFIG_PROP #include "../props/dual_prop.h" #include "../props/saber_sa22c_buttons.h" #include "../props/blaster.h" #undef PROP_TYPE #define PROP_TYPE DualProp #endif ``` -------------------------------- ### Reboot Proffieboard to DFU Mode Source: https://github.com/profezzorn/proffieos/wiki/ProffieBoard-Setup Use this command in the Arduino Serial Monitor to reboot the Proffieboard into DFU mode for driver installation. If the board is not recognized, use the onboard BOOT and RESET buttons. ```arduino RebootDFU ``` -------------------------------- ### Configure OLED Display with Bullet Count Source: https://github.com/profezzorn/proffieos/wiki/OLED-additional-features:-Bullet-counts Activates the OLED display and configures it to show bullet counts. This setup uses `DisplayHelper` with specific operations for clearing rectangles and writing bullet counts. ```cpp #ifdef CONFIG_BOTTOM DisplayHelper<128, uint32_t, BaseLayerOp, ClearRectangleOp<10, 80, 8, 24>, WriteBulletCountOp<10, 20, 5> > display_controller; SSD1306Template<128, uint32_t> display(&display_controller); #endif ``` -------------------------------- ### Enable Speaking Touch Values Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_TOP-section Temporarily add this define to your config to have ProffieOS speak the touch values of touch buttons for calibration. Calibrate one button at a time if multiple are present. ```cpp #define SPEAK_TOUCH_VALUES ``` -------------------------------- ### Enable Clash Strength Selection for Sounds Source: https://github.com/profezzorn/proffieos/wiki/ProffieOS6-"Real-Clash"-sounds-in-Fett263-Prop Add this define to your config to enable the selection of clash sounds based on clash strength. This requires the Fett263 prop file. ```cpp #define FETT263_CLASH_STRENGTH_SOUND // enables Clash Strength selection for sounds ``` -------------------------------- ### SubBlade Usage for Addressable LEDs Source: https://github.com/profezzorn/proffieos/wiki/Blade-Configuration Configures a single addressable LED strip to be separated into multiple sub-blades, each with its own style configuration. This example shows how to define four sub-blades using one data pin. ```cpp BladeConfig blades[] = { { 0, SubBlade(0, 1, WS2811BladePtr<145, WS2811_580kHz>()), SubBlade(2, 14, NULL), //Quilon A SubBlade(14,26, NULL), //Quilon B SubBlade(27, 145, NULL) //Main Blade CONFIGARRAY(presets) } }; ``` -------------------------------- ### Basic RGB LED Blade Configuration Source: https://github.com/profezzorn/proffieos/wiki/LED-channel-selection Use this for a standard RGB three-cree star setup with recommended resistors. The mapping is straightforward: red activates red, green activates green, and blue activates blue. ```cpp SimpleBladePtr, CreeXPE2GreenTemplate<0>, CreeXPE2BlueTemplate<240>, NoLED>() ``` -------------------------------- ### RGB Blade with Amber LED Configuration Source: https://github.com/profezzorn/proffieos/wiki/LED-channel-selection Configure an RGB blade where one of the LEDs is amber. The default amber LED struct has a color definition that complicates direct color mapping. This example shows the direct replacement. ```cpp SimpleBladePtr, CreeXPE2GreenTemplate<0>, CreeXPE2BlueTemplate<240>, NoLED>() ``` -------------------------------- ### Define a Simple Button in CONFIG_BUTTONS Source: https://github.com/profezzorn/proffieos/wiki/The-CONFIG_BUTTONS-section Use this format to define a basic button, specifying its type, event, pin, and a name for identification. Ensure the button type and event type are valid ProffieOS options. ```cpp #ifdef CONFIG_BUTTONS Button PowerButton(BUTTON_POWER, powerButtonPin, "pow"); Button AuxButton(BUTTON_AUX, auxPin, "aux"); #endif ```