Recommended way to post a config file

I haven’t found a helpful document that specifies all the different kinds of formatting discourse can do. However, a very common thing is to post a config file, and probably the easiest way to do that is to put three backticks “```” on a separate line in your post, then paste the contents of the config file and then end with another three backticks. It looks like this:

#ifdef CONFIG_TOP
#include "proffieboard_v2_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, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW>(), "fire"},
   { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
   { "RgueCmdr", "tracks/venus.wav",
    StyleFirePtr<BLUE, CYAN>(), "blue fire"},
   { "TthCrstl", "tracks/mars.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
   { "TeensySF", "tracks/mercury.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
   { "SmthJedi", "tracks/uranus.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
   { "SmthGrey", "tracks/venus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
   { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(), "gradient"},
   { "RgueCmdr", "tracks/mercury.wav",
    StyleRainbowPtr<300, 800>(), "rainbow"},
   { "TthCrstl", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"},
   { "TeensySF", "tracks/venus.wav",
    &style_pov, "POV"},
   { "SmthJedi", "tracks/mars.wav",
    &style_charging, "Battery\nLevel"}
};
BladeConfig blades[] = {
 { 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button AuxButton(BUTTON_AUX, auxPin, "aux");
#endif
#ifdef CONFIG_TOP

#include "proffieboard_v2_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
#define ENABLE_SSD1306
#define ENABLE_BLASTER_AUTO
#define BLASTER_SHOTS_UNTIL_EMPTY 30
#define BLASTER_JAM_PERCENTAGE 3

#endif


#ifdef CONFIG_PROP
#include "../props/blaster.h"
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
  // Default basic blast color with red audio flicker on blast
    { "bank1", "tracks/track01.wav",
  	StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
  { "bank2", "tracks/track02.wav",
  StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
  { "bank3", "tracks/track02.wav",
  StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
  { "bank4", "tracks/track02.wav",
  StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
  { "bank5", "tracks/track02.wav",
  StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
  { "bank6", "tracks/track02.wav",
  StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
  { "extra", "tracks/track02.wav",
  StylePtr<Lockup<BlastFadeout<BlastFadeout<Black,AudioFlicker<Black,Red>,250,EFFECT_FIRE>,AudioFlicker<Black,Blue>,1500,EFFECT_STUN>,AudioFlicker<Black,Red>>>(),
  },
};

BladeConfig blades[] = {
 { 0, SimpleBladePtr<CH1LED, CH2LED, CH3LED, NoLED, bladePowerPin4, bladePowerPin5, bladePowerPin6, -1>()
  , CONFIGARRAY(presets) },
};

#endif

#ifdef CONFIG_BUTTONS
Button FireButton(BUTTON_FIRE, powerButtonPin, "fire");
Button ModeButton(BUTTON_MODE_SELECT, auxPin, "modeselect");
#endif

EDIT: when creating a post, the feature preformatted text icon, as seen below, performs the same function.

1 Like

I guess both the blockquote button and the pre-formatted button works fine too.
To use them I have to paste the config file, then select it and then click the button which seems like more work to me, but whatever works, works…

Originally it didn’t occur to me to highlight the config and then click the button. Live and learn. :slight_smile:

3 Likes

blockquote test 123

backtick check 123
2 Likes

It seems like the 4-space (blockquote) method doesn’t do syntax highlighting like the the triple-backtick method.

1 Like

Now I am confused on how to post config.hehe

Just type 3 backticks, hit return.
Paste the config text, hit return.
type 3 backticks, hit the “Reply” button.

It’s just bookending your text with the backticks.

Screen Shot 2021-07-18 at 2.59.38 PM

like this would
be your config
file text here

Would it be best to post in Prof OS, Prof Brds, or Padaw. Ive been trying to figure out what I am doing wrong for two weeks now . Ive simplified my config down to one font. Its time to post/Lol
I would greatly appreciate any suggestions.

I’m curious, Is there a favorite Code Writing tool/App that this community likes or does everyone use different programs?

If it’s not hardware, the ProffieOS would be appropriate.

Everyone uses something different, but it should be something that is plain text based. Code friendly ones help by color coding, highlighting matching pairs of braces and quotes, correctly tab new lines for you etc…
While you might not need much of that for now, I suggest Sublime Text or something similar. It can be used basically, and provide a good visual experience to help keep it from looking overwhelming.
https://www.sublimetext.com/3

It really depends on what your question is.
If you have no idea, post in the Padawan area.