--led-slowdown-gpio = 2 default?

Is there a line of code I can change to make the default --led-slowdown-gpio=2 instead of using that command everytime?

The runtime options rgb_matrix::RuntimeOptions has a field gpio_slowdown which you can set before parsing the options. So in this typical start of a program, you’d do it like this:

  RGBMatrix::Options matrix_options;
  rgb_matrix::RuntimeOptions runtime_opt;
  runtime_opt.gpio_slowdown = 2;   // <- setting value
  if (!rgb_matrix::ParseOptionsFromFlags(&argc, &argv,
                                         &matrix_options, &runtime_opt)) {
    return usage(argv[0]);
  }
1 Like

I’ve now also just added a feature that if the library detects a Pi4, it automatically defaults to slowdown=2, as this seems to be needed most of the time.

So if you update the library from latest git, maybe this will already solve your problem if you’re on a Pi4.

2 Likes