Hi Peekay123,
It is possible to provide the Fritzing diagram or wiring diagram
Moin Moin,
iiiive got a Problem with the library i found in this Forum…
it is used to connect a 16x32 or 32x32 LED matrix to a particle photon. and it works beautifuly…
now i have a problem… i am using on one of the pins (A4) a servo which uses PWM signals. BUT as soon as i start the
matrix.begin()
method the servo wont do anything anymore … i guess because within matrix.begin() the inner timer is set to work differently and so the PWM is screwed up…
refreshTimer.begin(refreshISR, 200, uSec);
what can i do now to use the servo on A4?
THX in advance.
Hey @KWeb I moved your question over to this thread since that’s where most of the activity around the RGB Matrix panel and library is occurring.
@peekay123 do you have any thoughts for KWeb?
@KWeb, are you using one of my RGB Shields or did you hand wire everything?
Hey Thx for the answer.
i handwired it all.
just for clarification: it all works if i use it seperately. the servo works, and the matrix works. just when i try to use them at the same time it messes up.
and the servo only wont work while i am usign the line
refreshTimer.begin(refreshISR, 200, uSec);
within the library…i commented it out and the servo works fine, but the display of yourse now isnt working anymore…
EDIT:
i fumbled around a bit with the refreshTimer.begin and increased the worth from 200 to a couple thousand … then the servo works again… but only the servo… i decreased it to 1000, matrix works, servo dead…
i played with this a while and the magic barrier is 65535… (2^16)
anythin up to 65535 only the matrix works, anything higher and only the servo works…
Damn… i need both to work
@KWeb, a little background first. The SparkIntervalTimer library is used to create staggered interrupts to create a soft PWM output on the RGB lines for the RGBMatrixPanel library. Changing the timing values will destroy that timing and the panel will not work as expected. Furthermore, this is not the cause of your problems!
One reason you are having problems with A4 analog output is described in the SparkIntervalTimer library comments. In order to produce timer-based interrupts, the library takes over the specified timer’s base reload register to set the interrupt frequency. As such, any pins associated with that timer’s channels will be affected. The PWM on pin A4 is associated with hardware TIMR3 on the Photon and that is the first timer to be allocated by SparkIntervalTimer. So the base frequency of the Servo clock will be affected.
The other reason is that if you are following the examples, in your application you will have a section which defines the GPIO pins used for the display:
// NOTE: Version 4 of the RGBMatrix Shield only works with Photon and Electron (not Core)
#define RGBSHIELDVERSION 4
/** Define RGB matrix panel GPIO pins **/
#if (RGBSHIELDVERSION == 4) // Newest shield with SD socket onboard
#warning "new shield"
#define CLK D6
#define OE D7
#define LAT TX
#define A A0
#define B A1
#define C A2
#define D RX
#else
#warning "old shield"
#define CLK D6
#define OE D7
#define LAT A4
#define A A0
#define B A1
#define C A2
#define D A3
#endif
/****************************************/
Since you are having issues with A4, I’m going to assume you are using the “old shield” configuration. Note A4 is used for the LAT line to the panel. If you are not using the RX/TX lines on the Photon, you can reassign LAT to one of those GPIO and adjust your wiring accordingly. This should fix the problem.
sorry, i forgot to mention that i commented out that line in the code
//#define LAT A4 because that was the first thing thought might have been it.
i am already using the new shield version LAT is wired to TX.
THX again.
@KWeb, if you are using the “v4” configuration then A2-A5 will be open. Nonetheless, A4 operation is still affected by the hardware time. If you modify this line in RGBMatrixPanel.cpp:
refreshTimer.begin(refreshISR, 200, uSec);
to:
refreshTimer.begin(refreshISR, 200, uSec, TIMER7);
It will use a non-GPIO related timer which should free up A4 to work with PWM. Give it a shot and let me know!
That did it… THX a lot… I’ll show the project when i am done
@KWeb, well shiver me timbers!!! I’m going to make that a permanent change to the library (only for the Photon of course) so that there is not interference with timer-based GPIO. Thanks for the challenge and testing the fix!
Uh, one more question:
is there a way in the library to find out what color an led is set to?
Like:
getColorRGB(x,y);
in my project i am designing a game and i draw randomly sized shapes on the matrix and move them. the easiest way to see if i had a colission would be if i could read out if i just painted an obstacle over my object…
@KWeb, there is no function for that. I suggest you create your own array/buffer against which you can query color. You would memcpy your buffer to the display buffer whenever you want to update the display.
@peekay123,
Could I buy one of the shields from you?
Thanks,
Cole
@whackedspinach, of course! I sell them for US $30 plut $7.50 shipping.
@peekay123, Great, how can I pay you?
Also, is there anything else you would recommend picking up with the shield? I have the RGB Matrix and Photon already.
Hi, please send link on PCB DESIGN source. Thanks
I sell the shields so the design is not open source at this time.
@peekay123, maybe I missed in the comments, did you have a chance of sharing the completed complete wiring?
Would this work?
If you are referring to the original wired protoboard version the answer is no. I found that hand wiring the circuit did not work well with lots display issues so I designed a PCB instead. The latest version of the PCB (v4) also includes an onboard microSD socket. Hope that answers your question!