Aliexpressなどで販売されている64x32のフルカラードットマトリクスLED2枚とNucleo F401REを利用して、 E233系の駅停車時、路線名表示ありのLED側面行先表示を再現するプログラムです。 3秒間隔、3段階切替で、路線名、種別、行先、次停車駅を個別に指定することが可能です。
Dependencies: SDFileSystem mbed
Diff: main.cpp
- Revision:
- 7:79dfe71beb88
- Parent:
- 6:e6cb4a476422
- Child:
- 8:9d22c9910917
--- a/main.cpp Mon Oct 20 15:56:34 2014 +0000 +++ b/main.cpp Mon Oct 20 17:27:54 2014 +0000 @@ -53,7 +53,7 @@ unsigned char gm[32][6]; // Buffer with 32x6 bytes. Graphics memory if you like. unsigned long CT; // Counter for demo code -const int LEDBuffer [32][128] = { +int LEDBuffer [32][128] = { {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, @@ -87,27 +87,26 @@ {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - - }; - +bool R1Data1[32]={0,1,0,0,1,0,1,1,0,1}; +bool R1Data2[32]={0,1,0,0,1,0,1,1,0,1}; +bool R1Data3[32]={0,1,0,0,1,0,1,1,0,1}; +bool R1Data4[32]={0,1,0,0,1,0,1,1,0,1}; -void MkPattern() // Fill graphics buffer with colorful test pattern. -{ - unsigned int col,r,g,b; - r=0x0f0f0f0f; - g=0x33333333; - b=0x55555555; - for(col=0; col<32; col++) { - gm[col][0]=(r>>(col % 8)) & 0xff; // Shift red value and mask out LSB. - gm[col][1]=(g>>(col % 8)) & 0xff; // Shift green value and mask out LSB. - gm[col][2]=(b>>(col % 8)) & 0xff; // Shift blue value and mask out LSB. - gm[col][3]=gm[col][0]; // Copy top red byte to bottom red byte. - gm[col][4]=gm[col][1]; // Copy top green byte to bottom green byte. - gm[col][5]=gm[col][2]; // Copy top blue byte to bottom blue byte. - } -} +bool G1Data1[32]={0,0,1,0,1,1,0,1,1,0}; +bool G1Data2[32]={0,0,1,0,1,1,0,1,1,0}; +bool G1Data3[32]={0,0,1,0,1,1,0,1,0,0}; +bool G1Data4[32]={0,0,1,0,1,1,0,1,0,0}; + +bool B1Data1[32]={0,0,0,1,0,1,1,1,1,1}; +bool B1Data2[32]={0,0,0,1,0,1,1,1,1,0}; +bool B1Data3[32]={0,0,0,1,0,1,1,1,1,0}; +bool B1Data4[32]={0,0,0,1,0,1,1,1,1,0}; + + + + void Init() { @@ -117,160 +116,36 @@ OE = HIGH; //display off ABC = 0; CT=0; - MkPattern(); + } -void ShiftRight() -{ - unsigned char i,r,g,b; - r=gm[31][0]; // Save value of last column (top half) - g=gm[31][1]; - b=gm[31][2]; - for(i=31; i>0; i--) { // Copy value of column n to column n-1 - gm[i][0]=gm[i-1][0]; - gm[i][1]=gm[i-1][1]; - gm[i][2]=gm[i-1][2]; - } - gm[0][0]=r; // Paste saved values from last column to first column - gm[0][1]=g; - gm[0][2]=b; - // Do it again for the lower half - r=gm[31][3]; - g=gm[31][4]; - b=gm[31][5]; - - for(i=31; i>0; i--) { - gm[i][3]=gm[i-1][3]; - gm[i][4]=gm[i-1][4]; - gm[i][5]=gm[i-1][5]; - } - gm[0][3]=r; - gm[0][4]=g; - gm[0][5]=b; -} void WrRow(unsigned char Row) { // Write specified row (and row+8) to display. Valid input: 0 to 7. ABC = 7-Row; // Set row address for(int col=0; col<LED_Width; col++) { // To daisychain more displays, I guess you would have to increase this counter to n*32 columns. Might mirror though. - //R1 = gm[col][0] & (1<<Row); // Red bit, upper half - //G1 = gm[col][1] & (1<<Row); // Green bit, upper half - //B1 = gm[col][2] & (1<<Row); // Blue bit, upper half - //R2 = gm[col][3] & (1<<Row); // Red bit, lower half - //G2 = gm[col][4] & (1<<Row); // Green bit, lower half - //B2 = gm[col][5] & (1<<Row); // Blue bit, lower half if (LEDBuffer [(7-Row)][col] == 0){ R1 = R_Debug1; G1 = G_Debug1; B1 = B_Debug1; - }else if (LEDBuffer [(7-Row)][col] == 1){ - //Red - R1 = 1; - G1 = 0; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 2){ - //Green - R1 = 0; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 3){ - //Blue - R1 = 0; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 4){ - //RG - R1 = 1; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 5){ - //GB - R1 = 0; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 6){ - //RB - R1 = 1; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 7){ - //White - R1 = 1; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED Local) - R1 = 0; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R1 = 1; - G1 = 0; - B1 = 1; - }else{ - R1 = 0; - G1 = 0; - B1 = 0; + }else { + R1 = R1Data1[(LEDBuffer [(7-Row)][col])]; + G1 = G1Data1[(LEDBuffer [(7-Row)][col])]; + B1 = B1Data1[(LEDBuffer [(7-Row)][col])]; } - + if (LEDBuffer [(15-Row)][col] == 0){ R2 = R_Debug1; G2 = G_Debug1; B2 = B_Debug1; - }else if (LEDBuffer [(15-Row)][col] == 1){ - //Red - R2 = 1; - G2 = 0; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 2){ - //Green - R2 = 0; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 3){ - //Blue - R2 = 0; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 4){ - //RG - R2 = 1; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 5){ - //GB - R2 = 0; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 6){ - //RB - R2 = 1; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 7){ - //White - R2 = 1; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R2 = 0; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R2 = 1; - G2 = 0; - B2 = 1; - }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } + }else { + R2 = R1Data1[(LEDBuffer [(15-Row)][col])]; + G2 = G1Data1[(LEDBuffer [(15-Row)][col])]; + B2 = B1Data1[(LEDBuffer [(15-Row)][col])]; + } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock @@ -289,111 +164,21 @@ R1 = R_Debug2; G1 = G_Debug2; B1 = B_Debug2; - }else if (LEDBuffer [(7-Row)][col] == 1){ - //Red - R1 = 1; - G1 = 0; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 2){ - //Green - R1 = 0; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 3){ - //Blue - R1 = 0; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 4){ - //RG - R1 = 1; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 5){ - //GB - R1 = 0; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 6){ - //RB - R1 = 1; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 7){ - //White - R1 = 1; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R1 = 0; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R1 = 1; - G1 = 0; - B1 = 0; }else{ - R1 = 0; - G1 = 0; - B1 = 0; + R1 = R1Data2[(LEDBuffer [(7-Row)][col])]; + G1 = G1Data2[(LEDBuffer [(7-Row)][col])]; + B1 = B1Data2[(LEDBuffer [(7-Row)][col])]; } if (LEDBuffer [(15-Row)][col] == 0){ R2 = R_Debug2; G2 = G_Debug2; B2 = B_Debug2; - }else if (LEDBuffer [(15-Row)][col] == 1){ - //Red - R2 = 1; - G2 = 0; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 2){ - //Green - R2 = 0; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 3){ - //Blue - R2 = 0; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 4){ - //RG - R2 = 1; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 5){ - //GB - R2 = 0; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 6){ - //RB - R2 = 1; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 7){ - //White - R2 = 1; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R2 = 0; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R2 = 1; - G2 = 0; - B2 = 0; }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } + R2 = R1Data2[(LEDBuffer [(15-Row)][col])]; + G2 = G1Data2[(LEDBuffer [(15-Row)][col])]; + B2 = B1Data2[(LEDBuffer [(15-Row)][col])]; + } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock @@ -412,111 +197,21 @@ R1 = R_Debug3; G1 = G_Debug3; B1 = B_Debug3; - }else if (LEDBuffer [(7-Row)][col] == 1){ - //Red - R1 = 1; - G1 = 0; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 2){ - //Green - R1 = 0; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 3){ - //Blue - R1 = 0; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 4){ - //RG - R1 = 1; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 5){ - //GB - R1 = 0; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 6){ - //RB - R1 = 1; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 7){ - //White - R1 = 1; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R1 = 0; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R1 = 1; - G1 = 0; - B1 = 0; }else{ - R1 = 0; - G1 = 0; - B1 = 0; + R1 = R1Data3[(LEDBuffer [(7-Row)][col])]; + G1 = G1Data3[(LEDBuffer [(7-Row)][col])]; + B1 = B1Data3[(LEDBuffer [(7-Row)][col])]; } if (LEDBuffer [(15-Row)][col] == 0){ R2 = R_Debug3; G2 = G_Debug3; B2 = B_Debug3; - }else if (LEDBuffer [(15-Row)][col] == 1){ - //Red - R2 = 1; - G2 = 0; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 2){ - //Green - R2 = 0; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 3){ - //Blue - R2 = 0; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 4){ - //RG - R2 = 1; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 5){ - //GB - R2 = 0; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 6){ - //RB - R2 = 1; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 7){ - //White - R2 = 1; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R2 = 0; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R2 = 1; - G2 = 0; - B2 = 0; }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } + R2 = R1Data3[(LEDBuffer [(15-Row)][col])]; + G2 = G1Data3[(LEDBuffer [(15-Row)][col])]; + B2 = B1Data3[(LEDBuffer [(15-Row)][col])]; + } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock @@ -535,55 +230,10 @@ R1 = R_Debug4; G1 = G_Debug4; B1 = B_Debug4; - }else if (LEDBuffer [(7-Row)][col] == 1){ - //Red - R1 = 1; - G1 = 0; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 2){ - //Green - R1 = 0; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 3){ - //Blue - R1 = 0; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 4){ - //RG - R1 = 1; - G1 = 1; - B1 = 0; - }else if (LEDBuffer [(7-Row)][col] == 5){ - //GB - R1 = 0; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 6){ - //RB - R1 = 1; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 7){ - //White - R1 = 1; - G1 = 1; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R1 = 0; - G1 = 0; - B1 = 1; - }else if (LEDBuffer [(7-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R1 = 1; - G1 = 0; - B1 = 0; }else{ - R1 = 0; - G1 = 0; - B1 = 0; + R1 = R1Data4[(LEDBuffer [(7-Row)][col])]; + G1 = G1Data4[(LEDBuffer [(7-Row)][col])]; + B1 = B1Data4[(LEDBuffer [(7-Row)][col])]; } if (LEDBuffer [(15-Row)][col] == 0){ @@ -591,55 +241,10 @@ G2 = G_Debug4; B2 = B_Debug4; }else if (LEDBuffer [(15-Row)][col] == 1){ - //Red - R2 = 1; - G2 = 0; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 2){ - //Green - R2 = 0; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 3){ - //Blue - R2 = 0; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 4){ - //RG - R2 = 1; - G2 = 1; - B2 = 0; - }else if (LEDBuffer [(15-Row)][col] == 5){ - //GB - R2 = 0; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 6){ - //RB - R2 = 1; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 7){ - //White - R2 = 1; - G2 = 1; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 8){ - //Blue(Keihin-Tohoku E233 LED) - R2 = 0; - G2 = 0; - B2 = 1; - }else if (LEDBuffer [(15-Row)][col] == 9){ - //Pink-Red(Keihin-Tohoku E233 LED Rapid) - R2 = 1; - G2 = 0; - B2 = 0; - }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } + R2 = R1Data4[(LEDBuffer [(15-Row)][col])]; + G2 = G1Data4[(LEDBuffer [(15-Row)][col])]; + B2 = B1Data4[(LEDBuffer [(15-Row)][col])]; + } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock @@ -648,137 +253,7 @@ LAT = LOW; } -void WrRow5(unsigned char Row) -{ - // Write specified row (and row+8) to display. Valid input: 0 to 7. - ABC = 7-Row; // Set row address - for(int col=0; col<LED_Width; col++) { // To daisychain more displays, I guess you would have to increase this counter to n*32 columns. Might mirror though. - - if (LEDBuffer [(7-Row)][col] == 7){ - R1 = 1; - G1 = 1; - B1 = 1; - }else{ - R1 = 0; - G1 = 0; - B1 = 0; - } - if (LEDBuffer [(15-Row)][col] == 7){ - R2 = 1; - G2 = 1; - B2 = 1; - }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } - - CLK = HIGH; // tick (clock bit in) - CLK = LOW; // tock - } - LAT = HIGH; // Latch entire row - LAT = LOW; -} - -void WrRow6(unsigned char Row) -{ - // Write specified row (and row+8) to display. Valid input: 0 to 7. - ABC = 7-Row; // Set row address - for(int col=0; col<LED_Width; col++) { // To daisychain more displays, I guess you would have to increase this counter to n*32 columns. Might mirror though. - - if (LEDBuffer [(7-Row)][col] == 7){ - R1 = 1; - G1 = 1; - B1 = 1; - }else{ - R1 = 0; - G1 = 0; - B1 = 0; - } - - if (LEDBuffer [(15-Row)][col] == 7){ - R2 = 1; - G2 = 1; - B2 = 1; - }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } - - CLK = HIGH; // tick (clock bit in) - CLK = LOW; // tock - } - LAT = HIGH; // Latch entire row - LAT = LOW; -} - -void WrRow7(unsigned char Row) -{ - // Write specified row (and row+8) to display. Valid input: 0 to 7. - ABC = 7-Row; // Set row address - for(int col=0; col<LED_Width; col++) { // To daisychain more displays, I guess you would have to increase this counter to n*32 columns. Might mirror though. - - if (LEDBuffer [(7-Row)][col] == 7){ - R1 = 1; - G1 = 1; - B1 = 1; - }else{ - R1 = 0; - G1 = 0; - B1 = 0; - } - - if (LEDBuffer [(15-Row)][col] == 7){ - R2 = 1; - G2 = 1; - B2 = 1; - }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } - - CLK = HIGH; // tick (clock bit in) - CLK = LOW; // tock - } - LAT = HIGH; // Latch entire row - LAT = LOW; -} - -void WrRow8(unsigned char Row) -{ - // Write specified row (and row+8) to display. Valid input: 0 to 7. - ABC = 7-Row; // Set row address - for(int col=0; col<LED_Width; col++) { // To daisychain more displays, I guess you would have to increase this counter to n*32 columns. Might mirror though. - - if (LEDBuffer [(7-Row)][col] == 7){ - R1 = 1; - G1 = 1; - B1 = 1; - }else{ - R1 = 0; - G1 = 0; - B1 = 0; - } - - if (LEDBuffer [(15-Row)][col] == 7){ - R2 = 1; - G2 = 1; - B2 = 1; - }else{ - R2 = 0; - G2 = 0; - B2 = 0; - } - - CLK = HIGH; // tick (clock bit in) - CLK = LOW; // tock - } - LAT = HIGH; // Latch entire row - LAT = LOW; -} void WrRowOFF(unsigned char Row) { // Write specified row (and row+8) to display. Valid input: 0 to 7. @@ -820,7 +295,6 @@ for(int Row=0; Row<8; Row++) { OE = HIGH; // Disable output WrRow(Row); - //WrRow2(Row); //wait_us(10); OE = LOW; // Enable output @@ -854,42 +328,7 @@ wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. } - //5 -// for(int Row=0; Row<8; Row++) { -// OE = HIGH; // Disable output -// WrRow5(Row); -// //wait_us(10); -// OE = LOW; // Enable output -// -// wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. -// } - //6 -// for(int Row=0; Row<8; Row++) { -// OE = HIGH; // Disable output -// WrRow6(Row); -// //wait_us(10); -// OE = LOW; // Enable output -// -// wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. -// } - //7 -// for(int Row=0; Row<8; Row++) { -// OE = HIGH; // Disable output -// WrRow7(Row); -// //wait_us(10); -// OE = LOW; // Enable output -// -// wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. -// } - //8 -// for(int Row=0; Row<8; Row++) { -// OE = HIGH; // Disable output -// WrRow8(Row); -// //wait_us(10); -// OE = LOW; // Enable output -// -// wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. -// } + }