Aliexpressなどで販売されている64x32のフルカラードットマトリクスLED2枚とNucleo F401REを利用して、 E233系の駅停車時、路線名表示ありのLED側面行先表示を再現するプログラムです。 3秒間隔、3段階切替で、路線名、種別、行先、次停車駅を個別に指定することが可能です。

Dependencies:   SDFileSystem mbed

Committer:
chirashi
Date:
Mon Oct 20 18:05:34 2014 +0000
Revision:
8:9d22c9910917
Parent:
7:79dfe71beb88
Child:
9:ab87b0e361aa
3??????;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RRacer 0:1f58ecec51d6 1 /*
RRacer 0:1f58ecec51d6 2 The goal of this program is to show the basic connections and workings of Adafruits 32x16 RGB LED matrix board (http://www.adafruit.com/products/420),
RRacer 0:1f58ecec51d6 3 also sold on other places, for instance http://www.ebay.com/itm/PH6-RGB-Full-Color-LED-16-32-Dot-Matrix-Display-Module-/310303408628?pt=LH_DefaultDomain_0&hash=item483f8641f4 (no
RRacer 0:1f58ecec51d6 4 affiliation with either of them).
RRacer 0:1f58ecec51d6 5 This program is not intended to be highly optimized or a guideline in C programming in any way (more of the opposite actually).
RRacer 1:dd0dcd303d6d 6 To have more than 7 colors on this thing, you need to implement software PWM of some sort. I have obviously not done that, but if YOU do, please let me know!
RRacer 1:dd0dcd303d6d 7 Adafruit have a wicked demo program for an arduino - www.youtube.com/watch?v=lY-flFEfsHo
RRacer 0:1f58ecec51d6 8 There are probably lots of ways to make this perform better, perhaps by using Neal Hormans port of the Adafruit_GFX library (http://mbed.org/users/nkhorman/code/Adafruit_GFX/).
RRacer 0:1f58ecec51d6 9 No error checking or out-of-bounds checking is done. Use at your own peril.
RRacer 0:1f58ecec51d6 10 For more detailed information on the driver chip, see http://www.bjtopspace.com/ziliao/CYT62726.pdf
RRacer 0:1f58ecec51d6 11 Although the chips on my board says jx15020, I've been informed that they are equvivalent to the CYT62726, and so far it's a match.
RRacer 0:1f58ecec51d6 12 Feel free to use all or parts of this work.
RRacer 0:1f58ecec51d6 13 If you choose to do so, I would appreciate a small mentioning in the scrolling opening credits ;)
RRacer 0:1f58ecec51d6 14
RRacer 0:1f58ecec51d6 15 Best regards,
RRacer 0:1f58ecec51d6 16 Hugo Harming
RRacer 0:1f58ecec51d6 17 upgraded@hotmail.com
RRacer 0:1f58ecec51d6 18 */
RRacer 0:1f58ecec51d6 19
RRacer 0:1f58ecec51d6 20 #include "mbed.h"
RRacer 0:1f58ecec51d6 21 #define LOW 0
RRacer 0:1f58ecec51d6 22 #define HIGH 1
RRacer 0:1f58ecec51d6 23
chirashi 6:e6cb4a476422 24 #define R_Debug1 0
chirashi 6:e6cb4a476422 25 #define R_Debug2 0
chirashi 6:e6cb4a476422 26 #define R_Debug3 0
chirashi 6:e6cb4a476422 27 #define R_Debug4 0
chirashi 6:e6cb4a476422 28
chirashi 6:e6cb4a476422 29 #define G_Debug1 0
chirashi 6:e6cb4a476422 30 #define G_Debug2 0
chirashi 6:e6cb4a476422 31 #define G_Debug3 0
chirashi 6:e6cb4a476422 32 #define G_Debug4 0
chirashi 6:e6cb4a476422 33
chirashi 6:e6cb4a476422 34 #define B_Debug1 0
chirashi 6:e6cb4a476422 35 #define B_Debug2 0
chirashi 6:e6cb4a476422 36 #define B_Debug3 0
chirashi 6:e6cb4a476422 37 #define B_Debug4 0
chirashi 6:e6cb4a476422 38
chirashi 6:e6cb4a476422 39
chirashi 6:e6cb4a476422 40 #define LED_Width 128
chirashi 6:e6cb4a476422 41
chirashi 2:c1a9a2a0885d 42 BusOut ABC(D8,D9,D10); // Row address.
chirashi 2:c1a9a2a0885d 43 DigitalOut CLK(D11); // Data clock - rising edge
chirashi 2:c1a9a2a0885d 44 DigitalOut LAT(D12); // Data latch - active low (pulse up after data load)
chirashi 2:c1a9a2a0885d 45 DigitalOut OE(D13); // Output enable - active low (hold high during data load, bring low after LAT pulse)
chirashi 2:c1a9a2a0885d 46 DigitalOut R1(D2); // RED Serial in for upper half
chirashi 2:c1a9a2a0885d 47 DigitalOut R2(D3); // RED Serial in for lower half
chirashi 2:c1a9a2a0885d 48 DigitalOut G1(D4); // GREEN Serial in for upper half
chirashi 2:c1a9a2a0885d 49 DigitalOut G2(D5); // GREEN Serial in for lower half
chirashi 2:c1a9a2a0885d 50 DigitalOut B1(D6); // BLUE Serial in for upper half
chirashi 2:c1a9a2a0885d 51 DigitalOut B2(D7); // BLUE Serial in for lower half
RRacer 0:1f58ecec51d6 52
chirashi 8:9d22c9910917 53 Ticker ChangeTimer;
chirashi 8:9d22c9910917 54 int ChangeCount = 0;
chirashi 8:9d22c9910917 55
RRacer 0:1f58ecec51d6 56 unsigned char gm[32][6]; // Buffer with 32x6 bytes. Graphics memory if you like.
RRacer 0:1f58ecec51d6 57 unsigned long CT; // Counter for demo code
RRacer 0:1f58ecec51d6 58
chirashi 7:79dfe71beb88 59 int LEDBuffer [32][128] = {
chirashi 6:e6cb4a476422 60 {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},
chirashi 6:e6cb4a476422 61 {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},
chirashi 6:e6cb4a476422 62 {9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,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{8,8,8,8,8,8,8,8,8,8,8,7,7,8,8,8,8,8,8,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,7,7,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,4,0,0,4,4,4,0,0,0,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,4,4,4,0,0,4,4,4,4,0,4,0,0,0,4,0,0,4,0,0,4,0,0,0,4,4,4,4,0,4,0,0,0,4,0,0,0,4,4,4,4,0,0},
chirashi 8:9d22c9910917 130 {8,8,8,8,8,8,8,8,8,8,8,7,7,8,8,8,8,8,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,7,7,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,4,0,4,0,0,4,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,4,0,0,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0},
chirashi 8:9d22c9910917 131 {8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,4,4,0,4,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}
chirashi 8:9d22c9910917 132
chirashi 8:9d22c9910917 133 };
chirashi 8:9d22c9910917 134
chirashi 4:245f17936b1a 135
chirashi 7:79dfe71beb88 136 bool R1Data1[32]={0,1,0,0,1,0,1,1,0,1};
chirashi 7:79dfe71beb88 137 bool R1Data2[32]={0,1,0,0,1,0,1,1,0,1};
chirashi 7:79dfe71beb88 138 bool R1Data3[32]={0,1,0,0,1,0,1,1,0,1};
chirashi 7:79dfe71beb88 139 bool R1Data4[32]={0,1,0,0,1,0,1,1,0,1};
chirashi 4:245f17936b1a 140
chirashi 7:79dfe71beb88 141 bool G1Data1[32]={0,0,1,0,1,1,0,1,1,0};
chirashi 7:79dfe71beb88 142 bool G1Data2[32]={0,0,1,0,1,1,0,1,1,0};
chirashi 7:79dfe71beb88 143 bool G1Data3[32]={0,0,1,0,1,1,0,1,0,0};
chirashi 7:79dfe71beb88 144 bool G1Data4[32]={0,0,1,0,1,1,0,1,0,0};
chirashi 7:79dfe71beb88 145
chirashi 7:79dfe71beb88 146 bool B1Data1[32]={0,0,0,1,0,1,1,1,1,1};
chirashi 7:79dfe71beb88 147 bool B1Data2[32]={0,0,0,1,0,1,1,1,1,0};
chirashi 7:79dfe71beb88 148 bool B1Data3[32]={0,0,0,1,0,1,1,1,1,0};
chirashi 7:79dfe71beb88 149 bool B1Data4[32]={0,0,0,1,0,1,1,1,1,0};
chirashi 7:79dfe71beb88 150
chirashi 7:79dfe71beb88 151
chirashi 7:79dfe71beb88 152
chirashi 7:79dfe71beb88 153
RRacer 0:1f58ecec51d6 154
RRacer 0:1f58ecec51d6 155 void Init()
RRacer 0:1f58ecec51d6 156 {
RRacer 0:1f58ecec51d6 157 // Set up things to a known state
RRacer 0:1f58ecec51d6 158 CLK = LOW;
RRacer 0:1f58ecec51d6 159 LAT = LOW;
RRacer 0:1f58ecec51d6 160 OE = HIGH; //display off
RRacer 0:1f58ecec51d6 161 ABC = 0;
RRacer 0:1f58ecec51d6 162 CT=0;
chirashi 7:79dfe71beb88 163
RRacer 0:1f58ecec51d6 164 }
RRacer 0:1f58ecec51d6 165
RRacer 0:1f58ecec51d6 166
RRacer 0:1f58ecec51d6 167
chirashi 8:9d22c9910917 168 void WrRow(unsigned char Row, int Buffer[32][128])
RRacer 0:1f58ecec51d6 169 {
RRacer 0:1f58ecec51d6 170 // Write specified row (and row+8) to display. Valid input: 0 to 7.
chirashi 2:c1a9a2a0885d 171 ABC = 7-Row; // Set row address
chirashi 6:e6cb4a476422 172 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.
chirashi 5:532937f20397 173
chirashi 8:9d22c9910917 174 if (Buffer [(7-Row)][col] == 0){
chirashi 6:e6cb4a476422 175 R1 = R_Debug1;
chirashi 6:e6cb4a476422 176 G1 = G_Debug1;
chirashi 6:e6cb4a476422 177 B1 = B_Debug1;
chirashi 7:79dfe71beb88 178 }else {
chirashi 8:9d22c9910917 179 //R1 = R1Data1[(LEDBuffer [(7-Row)][col])];
chirashi 8:9d22c9910917 180 //G1 = G1Data1[(LEDBuffer [(7-Row)][col])];
chirashi 8:9d22c9910917 181 //B1 = B1Data1[(LEDBuffer [(7-Row)][col])];
chirashi 8:9d22c9910917 182 R1 = R1Data1[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 183 G1 = G1Data1[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 184 B1 = B1Data1[(Buffer [(7-Row)][col])];
chirashi 4:245f17936b1a 185 }
chirashi 7:79dfe71beb88 186
chirashi 8:9d22c9910917 187 if (Buffer [(15-Row)][col] == 0){
chirashi 6:e6cb4a476422 188 R2 = R_Debug1;
chirashi 6:e6cb4a476422 189 G2 = G_Debug1;
chirashi 6:e6cb4a476422 190 B2 = B_Debug1;
chirashi 7:79dfe71beb88 191 }else {
chirashi 8:9d22c9910917 192 R2 = R1Data1[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 193 G2 = G1Data1[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 194 B2 = B1Data1[(Buffer [(15-Row)][col])];
chirashi 7:79dfe71beb88 195 }
chirashi 4:245f17936b1a 196
chirashi 4:245f17936b1a 197 CLK = HIGH; // tick (clock bit in)
chirashi 4:245f17936b1a 198 CLK = LOW; // tock
chirashi 4:245f17936b1a 199 }
chirashi 4:245f17936b1a 200 LAT = HIGH; // Latch entire row
chirashi 4:245f17936b1a 201 LAT = LOW;
chirashi 4:245f17936b1a 202 }
chirashi 4:245f17936b1a 203
chirashi 8:9d22c9910917 204 void WrRow2(unsigned char Row,int Buffer[32][128])
chirashi 4:245f17936b1a 205 {
chirashi 4:245f17936b1a 206 // Write specified row (and row+8) to display. Valid input: 0 to 7.
chirashi 4:245f17936b1a 207 ABC = 7-Row; // Set row address
chirashi 6:e6cb4a476422 208 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.
chirashi 5:532937f20397 209
chirashi 8:9d22c9910917 210 if (Buffer [(7-Row)][col] == 0){
chirashi 6:e6cb4a476422 211 R1 = R_Debug2;
chirashi 6:e6cb4a476422 212 G1 = G_Debug2;
chirashi 6:e6cb4a476422 213 B1 = B_Debug2;
chirashi 5:532937f20397 214 }else{
chirashi 8:9d22c9910917 215 R1 = R1Data2[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 216 G1 = G1Data2[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 217 B1 = B1Data2[(Buffer [(7-Row)][col])];
chirashi 5:532937f20397 218 }
chirashi 5:532937f20397 219
chirashi 8:9d22c9910917 220 if (Buffer [(15-Row)][col] == 0){
chirashi 6:e6cb4a476422 221 R2 = R_Debug2;
chirashi 6:e6cb4a476422 222 G2 = G_Debug2;
chirashi 6:e6cb4a476422 223 B2 = B_Debug2;
chirashi 6:e6cb4a476422 224 }else{
chirashi 8:9d22c9910917 225 R2 = R1Data2[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 226 G2 = G1Data2[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 227 B2 = B1Data2[(Buffer [(15-Row)][col])];
chirashi 7:79dfe71beb88 228 }
chirashi 5:532937f20397 229
chirashi 5:532937f20397 230 CLK = HIGH; // tick (clock bit in)
chirashi 5:532937f20397 231 CLK = LOW; // tock
chirashi 5:532937f20397 232 }
chirashi 5:532937f20397 233 LAT = HIGH; // Latch entire row
chirashi 5:532937f20397 234 LAT = LOW;
chirashi 5:532937f20397 235 }
chirashi 5:532937f20397 236
chirashi 8:9d22c9910917 237 void WrRow3(unsigned char Row,int Buffer[32][128])
chirashi 5:532937f20397 238 {
chirashi 5:532937f20397 239 // Write specified row (and row+8) to display. Valid input: 0 to 7.
chirashi 5:532937f20397 240 ABC = 7-Row; // Set row address
chirashi 6:e6cb4a476422 241 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.
chirashi 5:532937f20397 242
chirashi 8:9d22c9910917 243 if (Buffer [(7-Row)][col] == 0){
chirashi 6:e6cb4a476422 244 R1 = R_Debug3;
chirashi 6:e6cb4a476422 245 G1 = G_Debug3;
chirashi 6:e6cb4a476422 246 B1 = B_Debug3;
chirashi 5:532937f20397 247 }else{
chirashi 8:9d22c9910917 248 R1 = R1Data3[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 249 G1 = G1Data3[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 250 B1 = B1Data3[(Buffer [(7-Row)][col])];
chirashi 5:532937f20397 251 }
chirashi 5:532937f20397 252
chirashi 8:9d22c9910917 253 if (Buffer [(15-Row)][col] == 0){
chirashi 6:e6cb4a476422 254 R2 = R_Debug3;
chirashi 6:e6cb4a476422 255 G2 = G_Debug3;
chirashi 6:e6cb4a476422 256 B2 = B_Debug3;
chirashi 5:532937f20397 257 }else{
chirashi 8:9d22c9910917 258 R2 = R1Data3[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 259 G2 = G1Data3[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 260 B2 = B1Data3[(Buffer [(15-Row)][col])];
chirashi 7:79dfe71beb88 261 }
chirashi 5:532937f20397 262
chirashi 5:532937f20397 263 CLK = HIGH; // tick (clock bit in)
chirashi 5:532937f20397 264 CLK = LOW; // tock
chirashi 5:532937f20397 265 }
chirashi 5:532937f20397 266 LAT = HIGH; // Latch entire row
chirashi 5:532937f20397 267 LAT = LOW;
chirashi 5:532937f20397 268 }
chirashi 5:532937f20397 269
chirashi 8:9d22c9910917 270 void WrRow4(unsigned char Row,int Buffer[32][128])
chirashi 5:532937f20397 271 {
chirashi 5:532937f20397 272 // Write specified row (and row+8) to display. Valid input: 0 to 7.
chirashi 5:532937f20397 273 ABC = 7-Row; // Set row address
chirashi 6:e6cb4a476422 274 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.
chirashi 5:532937f20397 275
chirashi 8:9d22c9910917 276 if (Buffer [(7-Row)][col] == 0){
chirashi 6:e6cb4a476422 277 R1 = R_Debug4;
chirashi 6:e6cb4a476422 278 G1 = G_Debug4;
chirashi 6:e6cb4a476422 279 B1 = B_Debug4;
chirashi 5:532937f20397 280 }else{
chirashi 8:9d22c9910917 281 R1 = R1Data4[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 282 G1 = G1Data4[(Buffer [(7-Row)][col])];
chirashi 8:9d22c9910917 283 B1 = B1Data4[(Buffer [(7-Row)][col])];
chirashi 5:532937f20397 284 }
chirashi 5:532937f20397 285
chirashi 8:9d22c9910917 286 if (Buffer [(15-Row)][col] == 0){
chirashi 6:e6cb4a476422 287 R2 = R_Debug4;
chirashi 6:e6cb4a476422 288 G2 = G_Debug4;
chirashi 6:e6cb4a476422 289 B2 = B_Debug4;
chirashi 6:e6cb4a476422 290 }else if (LEDBuffer [(15-Row)][col] == 1){
chirashi 8:9d22c9910917 291 R2 = R1Data4[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 292 G2 = G1Data4[(Buffer [(15-Row)][col])];
chirashi 8:9d22c9910917 293 B2 = B1Data4[(Buffer [(15-Row)][col])];
chirashi 7:79dfe71beb88 294 }
chirashi 5:532937f20397 295
chirashi 5:532937f20397 296 CLK = HIGH; // tick (clock bit in)
chirashi 5:532937f20397 297 CLK = LOW; // tock
chirashi 5:532937f20397 298 }
chirashi 5:532937f20397 299 LAT = HIGH; // Latch entire row
chirashi 5:532937f20397 300 LAT = LOW;
chirashi 5:532937f20397 301 }
chirashi 5:532937f20397 302
chirashi 4:245f17936b1a 303
chirashi 3:6dbbc0130e96 304 void WrRowOFF(unsigned char Row)
chirashi 3:6dbbc0130e96 305 {
chirashi 3:6dbbc0130e96 306 // Write specified row (and row+8) to display. Valid input: 0 to 7.
chirashi 3:6dbbc0130e96 307 ABC = 7-Row; // Set row address
chirashi 6:e6cb4a476422 308 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.
chirashi 3:6dbbc0130e96 309 R1 = 0; // Red bit, upper half
chirashi 3:6dbbc0130e96 310 G1 = 0; // Green bit, upper half
chirashi 3:6dbbc0130e96 311 B1 = 0; // Blue bit, upper half
chirashi 3:6dbbc0130e96 312 R2 = 0; // Red bit, lower half
chirashi 3:6dbbc0130e96 313 G2 = 0; // Green bit, lower half
chirashi 3:6dbbc0130e96 314 B2 = 0; // Blue bit, lower half
chirashi 3:6dbbc0130e96 315 CLK = HIGH; // tick (clock bit in)
chirashi 3:6dbbc0130e96 316 CLK = LOW; // tock
chirashi 3:6dbbc0130e96 317 }
chirashi 3:6dbbc0130e96 318 LAT = HIGH; // Latch entire row
chirashi 3:6dbbc0130e96 319 LAT = LOW;
chirashi 3:6dbbc0130e96 320 }
chirashi 3:6dbbc0130e96 321
RRacer 0:1f58ecec51d6 322 void Pset(unsigned char x,unsigned char y, unsigned char c)
RRacer 0:1f58ecec51d6 323 {
RRacer 0:1f58ecec51d6 324 // Set pixel (x,y) to color c
RRacer 0:1f58ecec51d6 325 // Manipulates graphics memory, so you won't see any change til you Paint() it.
RRacer 0:1f58ecec51d6 326 unsigned char ud,l,r0,g0,b0;
RRacer 0:1f58ecec51d6 327 ud=(y & 8)>>3; // 0 = upper half, 1 = lower half
RRacer 0:1f58ecec51d6 328 l=y & 7; // Extract row in upper/lower half
RRacer 0:1f58ecec51d6 329 r0=(c & 4) >>2; // Extract red bit from color
RRacer 0:1f58ecec51d6 330 g0=(c & 2) >>1; // Extract green bit from color
RRacer 0:1f58ecec51d6 331 b0=(c & 1); // Extract blue bit from color
RRacer 0:1f58ecec51d6 332 // *******Removes current bit ******* *Adds bit**
RRacer 0:1f58ecec51d6 333 gm[x][0+3*ud]=(gm[x][0+3*ud] & (255-(1<<(7-l))))+(r0<<(7-l)); // Red byte
RRacer 0:1f58ecec51d6 334 gm[x][1+3*ud]=(gm[x][1+3*ud] & (255-(1<<(7-l))))+(g0<<(7-l)); // Green byte
RRacer 0:1f58ecec51d6 335 gm[x][2+3*ud]=(gm[x][2+3*ud] & (255-(1<<(7-l))))+(b0<<(7-l)); // Blue byte
RRacer 0:1f58ecec51d6 336 }
RRacer 0:1f58ecec51d6 337
chirashi 8:9d22c9910917 338 void Paint(int Buffer2[32][128])
RRacer 0:1f58ecec51d6 339 {
RRacer 0:1f58ecec51d6 340 // Write graphics memory to display
chirashi 5:532937f20397 341 //1
RRacer 0:1f58ecec51d6 342 for(int Row=0; Row<8; Row++) {
RRacer 0:1f58ecec51d6 343 OE = HIGH; // Disable output
chirashi 8:9d22c9910917 344 WrRow(Row,Buffer2);
chirashi 5:532937f20397 345 //wait_us(10);
chirashi 5:532937f20397 346 OE = LOW; // Enable output
chirashi 5:532937f20397 347
chirashi 6:e6cb4a476422 348 wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh.
chirashi 5:532937f20397 349 }
chirashi 5:532937f20397 350 //2
chirashi 5:532937f20397 351 for(int Row=0; Row<8; Row++) {
chirashi 5:532937f20397 352 OE = HIGH; // Disable output
chirashi 5:532937f20397 353 //WrRow(Row);
chirashi 8:9d22c9910917 354 WrRow2(Row,Buffer2);
chirashi 5:532937f20397 355 //wait_us(10);
chirashi 5:532937f20397 356 OE = LOW; // Enable output
chirashi 5:532937f20397 357
chirashi 6:e6cb4a476422 358 wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh.
chirashi 5:532937f20397 359 }
chirashi 5:532937f20397 360 //3
chirashi 5:532937f20397 361 for(int Row=0; Row<8; Row++) {
chirashi 5:532937f20397 362 OE = HIGH; // Disable output
chirashi 8:9d22c9910917 363 WrRow3(Row,Buffer2);
chirashi 5:532937f20397 364 //wait_us(10);
chirashi 5:532937f20397 365 OE = LOW; // Enable output
chirashi 5:532937f20397 366
chirashi 6:e6cb4a476422 367 wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh.
chirashi 5:532937f20397 368 }
chirashi 5:532937f20397 369 //4
chirashi 5:532937f20397 370 for(int Row=0; Row<8; Row++) {
chirashi 5:532937f20397 371 OE = HIGH; // Disable output
chirashi 8:9d22c9910917 372 WrRow4(Row,Buffer2);
chirashi 5:532937f20397 373 //wait_us(10);
RRacer 0:1f58ecec51d6 374 OE = LOW; // Enable output
chirashi 4:245f17936b1a 375
chirashi 6:e6cb4a476422 376 wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh.
chirashi 5:532937f20397 377 }
chirashi 7:79dfe71beb88 378
chirashi 5:532937f20397 379
chirashi 4:245f17936b1a 380 }
chirashi 4:245f17936b1a 381
RRacer 0:1f58ecec51d6 382
chirashi 3:6dbbc0130e96 383
chirashi 3:6dbbc0130e96 384 void PaintOFF()
chirashi 3:6dbbc0130e96 385 {
chirashi 3:6dbbc0130e96 386 // Write graphics memory to display
chirashi 3:6dbbc0130e96 387 for(int Row=0; Row<8; Row++) {
chirashi 3:6dbbc0130e96 388 OE = HIGH; // Disable output
chirashi 3:6dbbc0130e96 389 WrRowOFF(Row);
chirashi 3:6dbbc0130e96 390 OE = LOW; // Enable output
chirashi 4:245f17936b1a 391 wait_us(50); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh.
chirashi 3:6dbbc0130e96 392 }
chirashi 3:6dbbc0130e96 393 }
chirashi 3:6dbbc0130e96 394
chirashi 8:9d22c9910917 395 void TimerTick(){
chirashi 8:9d22c9910917 396 if (ChangeCount == 0){
chirashi 8:9d22c9910917 397
chirashi 8:9d22c9910917 398
chirashi 8:9d22c9910917 399
chirashi 8:9d22c9910917 400
chirashi 8:9d22c9910917 401 ChangeCount = ChangeCount + 1;
chirashi 8:9d22c9910917 402 }else if(ChangeCount == 1 ){
chirashi 8:9d22c9910917 403
chirashi 8:9d22c9910917 404
chirashi 8:9d22c9910917 405 ChangeCount = ChangeCount + 1;
chirashi 8:9d22c9910917 406 //ChangeCount = 0;
chirashi 8:9d22c9910917 407 }else if(ChangeCount == 2){
chirashi 8:9d22c9910917 408
chirashi 8:9d22c9910917 409 ChangeCount = 0;
chirashi 8:9d22c9910917 410 }else{
chirashi 8:9d22c9910917 411
chirashi 8:9d22c9910917 412
chirashi 8:9d22c9910917 413 }
chirashi 8:9d22c9910917 414
chirashi 8:9d22c9910917 415
chirashi 8:9d22c9910917 416 }
chirashi 3:6dbbc0130e96 417
RRacer 0:1f58ecec51d6 418 int main()
RRacer 0:1f58ecec51d6 419 {
RRacer 0:1f58ecec51d6 420 Init(); // Set things up
chirashi 8:9d22c9910917 421 ChangeTimer.attach(&TimerTick,5);
chirashi 8:9d22c9910917 422
RRacer 0:1f58ecec51d6 423 while(1) { // Messy demo loop following...
RRacer 0:1f58ecec51d6 424 CT++;
chirashi 8:9d22c9910917 425 if (ChangeCount == 0){
chirashi 8:9d22c9910917 426 Paint(LEDBuffer);
chirashi 8:9d22c9910917 427 }else if(ChangeCount == 1){
chirashi 8:9d22c9910917 428 Paint(LEDBuffer2);
chirashi 8:9d22c9910917 429 }else if(ChangeCount == 2){
chirashi 8:9d22c9910917 430 Paint(LEDBuffer3);
chirashi 8:9d22c9910917 431 }
chirashi 4:245f17936b1a 432
chirashi 4:245f17936b1a 433 //if((CT<=2560)||(CT>=2880 && CT<=4160)) {
chirashi 4:245f17936b1a 434 // Paint(); // Refresh display
chirashi 4:245f17936b1a 435 // if((CT % 20)==0) ShiftRight(); // After every 20 refresh, do a ShiftRight
chirashi 4:245f17936b1a 436 //}
chirashi 3:6dbbc0130e96 437
chirashi 4:245f17936b1a 438 //if(CT==2560) {
chirashi 4:245f17936b1a 439 // for(int c=0; c<8; c++) {
chirashi 4:245f17936b1a 440 // for(int x=c; x<(31-c); x++) {// Top side
chirashi 4:245f17936b1a 441 // Pset(x,c,c);
chirashi 4:245f17936b1a 442 // Paint(); // Display refresh time sets loop duration.
chirashi 4:245f17936b1a 443 // }
chirashi 4:245f17936b1a 444 // for(int y=c; y<(15-c); y++) {// Right side
chirashi 4:245f17936b1a 445 // Pset(31-c,y,c);
chirashi 4:245f17936b1a 446 // Paint();
chirashi 4:245f17936b1a 447 // }
chirashi 4:245f17936b1a 448 // for(int x=(31-c); x>=c; x--) {// Bottom side
chirashi 4:245f17936b1a 449 // Pset(x,(15-c),c);
chirashi 4:245f17936b1a 450 // Paint();
chirashi 4:245f17936b1a 451 // }
chirashi 4:245f17936b1a 452 // for(int y=(15-c); y>=c; y--) { // Left side
chirashi 4:245f17936b1a 453 // Pset(c,y,c);
chirashi 4:245f17936b1a 454 // Paint();
chirashi 4:245f17936b1a 455 // }
chirashi 4:245f17936b1a 456 // }
chirashi 4:245f17936b1a 457 //}
chirashi 3:6dbbc0130e96 458
RRacer 0:1f58ecec51d6 459 if(CT>4160) {
chirashi 4:245f17936b1a 460 //MkPattern(); // Restore original priceless artwork
RRacer 0:1f58ecec51d6 461 CT=0; // Start all over.
RRacer 0:1f58ecec51d6 462 }
chirashi 3:6dbbc0130e96 463
chirashi 4:245f17936b1a 464 //PaintOFF();
chirashi 6:e6cb4a476422 465 //wait_us(10);
RRacer 0:1f58ecec51d6 466 }
chirashi 3:6dbbc0130e96 467
RRacer 0:1f58ecec51d6 468 }