ArduinoOnPc-FastLED-GFX-LEDMatrix icon indicating copy to clipboard operation
ArduinoOnPc-FastLED-GFX-LEDMatrix copied to clipboard

unused RPi GPIO pins get reset

Open PHimmel opened this issue 4 years ago • 5 comments

Hello Marc,

Firstly, thank you for putting together this awesome program! I love running these beautiful graphics on my RPi4.

I currently have a SMPS (to power the matrices) connected to a solid state relay. The relay is connected to pin 40 , for ground, and pin 29, to set the state of the relay. When I run any of the sample programs in example/, it sets 29 from 1 to 0. This occurs both when it initializes and when the command is keyboard interrupted, or if it is suspended. This puts the relay in an inactive state and turns off the SMPS. The demos/ in the hzeller library (which your software is in-part build off of, I believe) do not do this.

I skimmed over this core repository, as well as your related repos, and haven't found a specific reference to pin manipulation. So I was wondering where this code might be located.

Thanks again Marc!

-Peter

PHimmel avatar Aug 21 '21 01:08 PHimmel

Hi, glad that this lib is of interest to you. Damn, that is perplexing, I'm honestly not sure why this is happening, nothing in my glue code touches GPIOs, and arduinoonpc wasn't even written for rPi, so it doesn't touch any GPIOs either. My guess is that it has to be the rpi-rgb-panel lib, and that you have it configured in a way that it uses multiple channels. That library uses every single GPIO on 3 channels, so this is likely an initialization difference and it's blindly sending signals to other GPIOs you aren't using for panels

marcmerlin avatar Aug 21 '21 15:08 marcmerlin

Thanks for the quick reply 👍 Okay, and where is that lib?

PHimmel avatar Aug 23 '21 05:08 PHimmel

how do you initialize the matrix, using neomatrix_config? Please show me that code and/or confirm how many channels in parallel you init

marcmerlin avatar Aug 23 '21 13:08 marcmerlin

Yes, that's what I'm using to initialize. Here's my neomatrix_config.h file and the specific line setting the parallel number to 2: https://github.com/PHimmel/matrix_control/blob/56e10096c305a0ddff4fd8bb00716739c8bac216/neomatrix_config.h#L1045

PHimmel avatar Aug 24 '21 03:08 PHimmel

Ok, try

  1. Add #pragma message "hello" to that block, to make sure it is being selected by ifdef
  2. set parallel to 1

marcmerlin avatar Aug 24 '21 07:08 marcmerlin