Open andrei0807 opened 5 years ago
that is an unusual scan mode that I have not come across before; probably needs slight adjustments in the code. Can you take a picture of the connector on the matrix PCB including the labeling ? Do you have a datasheet ?
1/3 implies that we have essentially have in each half display 3 stripes of 5 led rows if it otherwise behaves as usual panels. Probably sufficient to just write another multiplex mapper.
Thanks for your response, I will send you datasheet now
Does it make sense? Is this enough? Can I use this library for this LED matrix?
Yeah, this looks doable if it otherwise works with the library. If you connect it to the library, do you get any output (albeit garbled) when you run the demo ?
You essentially need to add a new multiplex mapper in lib/multiplex-mappers.cc
. I am currently travelling (eventually hitting Chaos Communication Camp), so can't really help much right now.
Thanks for your response and sorry to disturb your rest. Should I add class like this?
@hzeller Can you explain about parameter's mean and function's login?
See the header files for the corresponding class you implement. A Mjultiplex mapper is based on a PixelMapper who's parameters etc are described in the corresponding header in detal https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/include/pixel-mapper.h
The Multiplex mapper is derived from that, and only adds one more method the EditColsRows()
https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/lib/multiplex-mappers-internal.h
.. there is already an implementation in MultiplexMapperBase
, that implements that so you could instantiate that with 3 as parameter; Then the only function you need to implement is MapSinglePanel()
, which takes the original x/y [0..29, 0..29] range and maps it to the new [0..149, 0..9] range. Something like this would be probably a good starting point:
class ThirdMultiplexMapper : public MultiplexMapperBase {
public:
ThirdMultiplexMapper() : MultiplexMapperBase("Third", 3) {}
void MapSinglePanel(...) const {
// ... implementation according to your data-sheet
}
};
Then register it in CreateMultiplexMapperList()
and it should be available via the command-line flags.
https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/lib/multiplex-mappers.cc
/*
Here is where the registration happens.
If you add an instance of the mapper here, it will automatically be
made available in the --led-multiplexing commandline option.
*/
static MuxMapperList *CreateMultiplexMapperList() {
MuxMapperList *result = new MuxMapperList();
// Here, register all multiplex mappers from above.
result->push_back(new StripeMultiplexMapper());
result->push_back(new CheckeredMultiplexMapper());
result->push_back(new SpiralMultiplexMapper());
result->push_back(new ZStripeMultiplexMapper("ZStripe", 0, 8));
result->push_back(new ZStripeMultiplexMapper("ZnMirrorZStripe", 4, 4));
result->push_back(new CoremanMapper());
result->push_back(new Kaler2ScanMapper());
result->push_back(new ZStripeMultiplexMapper("ZStripeUneven", 8, 0));
result->push_back(new P10MapperZ());
result->push_back(new ThirdMultiplexMapper("Third", 3));
return result;
}
const MuxMapperList &GetRegisteredMultiplexMappers() {
static const MuxMapperList *all_mappers = CreateMultiplexMapperList();
return *all_mappers;
}
@angelogoncalve Thanks for your response. Can you write MapSinglePanel function for my led matrix?
result->push_back(new ThirdMultiplexMapper("Third", 3)); Value 3 is correct? I think it's 5
@hzeller How are you? I added new MultiplexMapperBase class but my LED doesn't work now. Do I only have to add a new MultiplexMapperBase class? Don't I need any more settings?
How is your implementation @andrei0807 ?
$ sudo ./demo D 1 --led-gpio-mapping adafruit-hat --led-multiplexing 10 --led-rows 30 --led-cols 30 I changed code and used like command line.
@hzeller Do you have time for me?
Did you get it to work ? If so, send a pull request, so that others can make use of it as well.
I have led matrix of 30x30, scan mode 1/3. I am going to control this on Pi using this library. But it was not work correctly. How to set params for this led matrix. Please help me. Thanks.