faicalsaid / WindowsIOTLEDMatrix

This Library allows you to use 32x32 chained LED Matrices with your Raspberry Pi 3 on Windows IOT Core
MIT License
7 stars 4 forks source link

Connect Raspberry Pi 3 to P10 LED matrix 16x32 #2

Open DebaGracias opened 6 years ago

DebaGracias commented 6 years ago

Hi All, I have installed Windows 10 IOT Core on my Raspberry Pi 3.I wanted to display a scrolling text on a P10 LED matrix display 16x32 . The P10 led matrix has pin configuration as shown in the attached image.Searching on net I found that I need to use this library https://www.hackster.io/highwave/32x32-chained-led-matrices-with-win-iot-core-on-rpi3-f1cb92 to load the text on the LED.However I was not able to get it working,I can see few rows of LED being lit and nothing else.Can somebody provide me with an example or describe how it can be done.Is there any tutorial explaining the connections between Raspberry Pi 3 and P10 LED matrix ? p10 1

Thanks, Debasish

PlatinumFusion commented 5 years ago

I have finally got my panel to work. It is a 16x32 1:4 scan. I will share my changes below:

In the RgbMartis.cs file:

int Width = 64 //Width needs to be 2x the actual width. If you have 2 chained it would be 128

for (int b = 0; b < pwmbits; b++) { int mask = 1 << b; if (y<4) { // Upper sub-panel on top chain Panels display.planes[b].colormatrix[y].color1[x].A = c.A; display.planes[b].colormatrix[y].color1[x].R = (byte)((red & mask) == mask ? 255 : 0); display.planes[b].colormatrix[y].color1[x].G = (byte)((green & mask) == mask ? 255 : 0); display.planes[b].colormatrix[y].color1[x].B = (byte)((blue & mask) == mask ? 255 : 0);} else if (y>3 && y<8) { // Lower sub-panel on top chain Row display.planes[b].colormatrix[y - 4].color2[x].A = c.A; display.planes[b].colormatrix[y - 4].color2[x].R = (byte)((red & mask) == mask ? 255 : 0); display.planes[b].colormatrix[y - 4].color2[x].G = (byte)((green & mask) == mask ? 255 : 0); display.planes[b].colormatrix[y - 4].color2[x].B = (byte)((blue & mask) == mask ? 255 : 0); }

Below I had to draw a pixel line-by-line, so that I could figure out how to write a pixel translator. My code below should draw each pixel slow enough so that you can see how it maps out on the display. In the StartupTask.cs file:

DateTime epoch = DateTime.UtcNow; long millis = (long)((DateTime.UtcNow - epoch).TotalMilliseconds); while (true) { millis = (long)((DateTime.UtcNow - epoch).TotalMilliseconds); if (millis > 1) // How fast do you want to draw the pixels { if (x >= 63) // Set this to the Width defined above { for (int y = 0; y < x; y++) { } x = 0; y1++; } else { if (y1 <= 8) //Because the Width is set to 2x of the actual width, set this to 1/2 of the actual height. You can change this later after your get your mappings. { matrix.drawPixel(x, y1, Color.FromArgb(255, 255, 255, 255)); //Debug.Write(x + "," + y1 + " "); //Debug.WriteLine(x + "," + y1); } else { } x++; } epoch = DateTime.UtcNow; } //*** }