I have been able to use the multiplexing to write to a single line on the top or bottom half or any combination thereof, however, I have yet to be able to write to only a singular LED i.e. (x,y) = 20, 25. At the moment I can only drive an entire row at a time. I have attached an image and my current code with the hopes that someone may have more experience than I in this endeavor.
A zip of my project is available here.
Code: Select all
Cy_GPIO_Write(En_PORT, En_NUM, 1);
Cy_GPIO_Write(R2_PORT, R2_NUM, 0);
Cy_GPIO_Write(G1_PORT, G1_NUM, 0);
Cy_GPIO_Write(G2_PORT, G2_NUM, 0);
Cy_GPIO_Write(B1_PORT, B1_NUM, 0);
Cy_GPIO_Write(B1_PORT, B2_NUM, 0);
while (1) {
Cy_GPIO_Write(A_PORT, A_NUM, 0); //a
Cy_GPIO_Write(B_PORT, B_NUM, 0);
Cy_GPIO_Write(C_PORT, C_NUM, 0);
Cy_GPIO_Write(D_PORT, D_NUM, 0); // d
for (int j = 0; j < 256; j++) {
Cy_GPIO_Write(G1_PORT, G1_NUM, 1);
Cy_GPIO_Write(Clk_PORT, Clk_NUM, 1);
CyDelayCycles(10);
Cy_GPIO_Write(Clk_PORT, Clk_NUM, 0);
CyDelayCycles(10);
}
Cy_GPIO_Write(Lat_PORT, Lat_NUM, 1);
Cy_GPIO_Write(Lat_PORT, Lat_NUM, 0);
CyDelayCycles(100);
CyDelayCycles(10);