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

Dependencies:   SDFileSystem mbed

Revision:
2:c1a9a2a0885d
Parent:
1:dd0dcd303d6d
Child:
3:6dbbc0130e96
--- a/main.cpp	Mon Nov 19 02:16:13 2012 +0000
+++ b/main.cpp	Sun Oct 19 09:50:34 2014 +0000
@@ -21,16 +21,16 @@
 #define LOW 0
 #define HIGH 1
 
-BusOut ABC(p24,p25,p26); // Row address.
-DigitalOut CLK(p21);    //  Data clock    - rising edge
-DigitalOut LAT(p22);    //  Data latch    - active low (pulse up after data load)
-DigitalOut OE(p23);     //  Output enable - active low (hold high during data load, bring low after LAT pulse)
-DigitalOut R1(p27);     //  RED   Serial in for upper half
-DigitalOut R2(p28);     //  RED   Serial in for lower half
-DigitalOut G1(p5);      //  GREEN Serial in for upper half
-DigitalOut G2(p6);      //  GREEN Serial in for lower half
-DigitalOut B1(p7);      //  BLUE  Serial in for upper half
-DigitalOut B2(p8);      //  BLUE  Serial in for lower half
+BusOut ABC(D8,D9,D10); // Row address.
+DigitalOut CLK(D11);    //  Data clock    - rising edge
+DigitalOut LAT(D12);    //  Data latch    - active low (pulse up after data load)
+DigitalOut OE(D13);     //  Output enable - active low (hold high during data load, bring low after LAT pulse)
+DigitalOut R1(D2);     //  RED   Serial in for upper half
+DigitalOut R2(D3);     //  RED   Serial in for lower half
+DigitalOut G1(D4);      //  GREEN Serial in for upper half
+DigitalOut G2(D5);      //  GREEN Serial in for lower half
+DigitalOut B1(D6);      //  BLUE  Serial in for upper half
+DigitalOut B2(D7);      //  BLUE  Serial in for lower half
 
 unsigned char gm[32][6]; // Buffer with 32x6 bytes. Graphics memory if you like.
 unsigned long CT; //        Counter for demo code
@@ -95,7 +95,7 @@
 void WrRow(unsigned char Row)
 {
     // Write specified row (and row+8) to display. Valid input: 0 to 7.
-    ABC=7-Row; // Set row address
+    ABC = 7-Row; // Set row address
     for(int col=0; col<32; 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
@@ -166,6 +166,7 @@
                 }
             }
         }
+        //if CT > 4160 then 
         if(CT>4160) {
             MkPattern(); // Restore original priceless artwork
             CT=0; // Start all over.