Aliexpressなどで販売されている64x32のフルカラードットマトリクスLED2枚とNucleo F401REを利用して、 E233系の駅停車時、路線名表示ありのLED側面行先表示を再現するプログラムです。 3秒間隔、3段階切替で、路線名、種別、行先、次停車駅を個別に指定することが可能です。
Dependencies: SDFileSystem mbed
main.cpp
- Committer:
- chirashi
- Date:
- 2014-11-11
- Revision:
- 10:4d9cf202a845
- Parent:
- 9:ab87b0e361aa
- Child:
- 11:4be8dcbad9f1
File content as of revision 10:4d9cf202a845:
/* 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), 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 affiliation with either of them). This program is not intended to be highly optimized or a guideline in C programming in any way (more of the opposite actually). 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! Adafruit have a wicked demo program for an arduino - www.youtube.com/watch?v=lY-flFEfsHo 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/). No error checking or out-of-bounds checking is done. Use at your own peril. For more detailed information on the driver chip, see http://www.bjtopspace.com/ziliao/CYT62726.pdf 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. Feel free to use all or parts of this work. If you choose to do so, I would appreciate a small mentioning in the scrolling opening credits ;) Best regards, Hugo Harming upgraded@hotmail.com */ #include "mbed.h" #define LOW 0 #define HIGH 1 #define R_Debug1 0 #define R_Debug2 0 #define R_Debug3 0 #define R_Debug4 0 #define G_Debug1 0 #define G_Debug2 0 #define G_Debug3 0 #define G_Debug4 0 #define B_Debug1 0 #define B_Debug2 0 #define B_Debug3 0 #define B_Debug4 0 #define LED_Width 64 #define LED_Height 16 BusOut ABC(D8,D9,D10,D14); // 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 Ticker ChangeTimer; int ChangeCount = 0; unsigned char gm[32][6]; // Buffer with 32x6 bytes. Graphics memory if you like. unsigned long CT; // Counter for demo code int LEDBuffer [32][128] = { {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,7,7,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,7,7,0,7,7,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0}, {8,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,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,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7,7,7,0,0,0,0,0,0,7,7,0,0,7,7,0,0,0,0,0,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,0,0,0,0}, {8,8,8,8,8,8,8,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,7,7,7,7,7,7,7,7,8,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,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,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7,7,7,7,7,7,0,0,0,0,0,0,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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}, {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} }; int LEDBuffer2[32][128] = { }; int LEDBuffer3[32][128] = { {11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,0,0,7,7,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {11,11,11,11,0,11,11,11,0,11,0,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,11,11,11,11,11,11,11,0,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,7,7,0,7,7,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,11,0,0,0,0,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {11,11,11,0,7,0,11,0,7,0,7,0,11,11,11,11,11,11,0,7,0,11,0,0,0,0,7,7,0,11,11,11,11,11,0,7,0,11,11,0,0,7,0,0,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,7,7,7,0,7,11,11,11,11,11,11,0,7,0,0,0,11,11,0,7,7,7,7,7,0,7,7,7,7,0,11,11,0,7,0,0,0,7,0,0,0,11,0,0,0,0,7,0,0,0,0,11,11,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0}, {11,11,0,0,7,0,11,7,7,7,7,7,0,11,11,11,11,11,11,0,7,0,7,7,7,7,0,0,11,11,11,11,11,0,7,0,0,11,0,7,7,7,7,7,0,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,7,7,0,7,11,11,11,11,11,0,7,7,7,7,7,0,11,0,7,0,7,0,0,0,7,0,0,7,0,11,11,0,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,7,7,0,11,0,0,4,0,0,0,0,0,4,0,0,0,0,0,0,0}, {11,0,7,7,7,7,0,0,7,0,7,0,0,11,11,11,11,11,0,11,0,0,7,0,0,0,0,0,0,11,11,11,0,7,0,0,7,0,0,7,0,0,0,7,0,11,11,11,0,0,0,0,0,7,7,7,7,7,7,0,7,7,0,7,11,11,11,11,0,7,0,0,0,7,0,11,11,0,7,7,7,7,7,0,7,0,0,7,0,11,11,0,7,0,0,0,0,0,0,0,11,0,0,0,0,7,0,0,0,0,11,11,0,0,0,4,0,0,0,0,4,0,0,0,0,0,0,0}, {11,11,0,0,7,0,7,7,7,7,7,7,7,0,11,11,11,0,7,0,11,0,7,7,7,7,7,7,7,0,11,11,11,0,7,0,7,0,0,7,7,7,7,7,0,11,11,11,0,0,0,0,0,7,7,7,7,7,7,0,0,0,7,7,11,11,0,0,7,7,0,0,7,0,11,11,11,0,7,0,7,0,0,0,7,0,0,7,0,11,0,7,0,0,7,7,7,7,7,0,11,0,7,7,7,7,7,7,7,0,11,11,0,0,0,0,4,0,0,0,4,4,4,4,4,4,4,0}, {11,11,0,7,7,0,0,0,0,7,0,0,0,11,11,11,11,11,0,7,0,0,7,0,0,0,7,0,0,11,11,11,11,11,0,7,0,0,0,7,0,0,0,7,0,11,11,11,0,0,0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,11,0,0,0,0,0,7,7,7,7,0,0,0,7,7,0,0,11,11,0,0,7,7,7,7,7,7,7,0,0,11,0,7,7,0,7,0,7,0,7,0,11,11,0,7,0,0,7,7,7,7,7,0,11,0,0,0,0,7,0,0,0,0,11,11,0,0,0,4,0,0,0,0,0,4,0,4,0,0,0,0}, {11,11,11,0,7,11,0,7,7,7,7,7,0,11,11,11,11,11,0,7,0,11,0,7,0,0,7,0,11,11,11,11,0,7,0,7,7,0,0,7,0,7,0,7,0,11,11,11,0,0,0,0,0,7,0,7,7,0,0,7,7,7,7,0,11,11,11,0,7,0,0,0,0,0,7,0,11,0,7,7,0,0,7,0,7,0,0,7,0,11,0,7,0,11,0,0,7,0,0,11,0,7,7,7,7,7,7,7,7,7,0,11,0,0,0,4,0,0,0,0,0,4,0,4,0,0,0,0}, {11,11,11,0,7,0,0,0,7,0,7,0,0,11,11,11,11,0,7,0,11,0,7,0,11,11,0,7,0,11,11,11,0,7,0,7,0,0,7,0,0,7,0,0,7,0,11,11,0,0,0,0,0,0,0,7,7,0,0,0,0,0,7,7,11,11,11,0,7,0,0,0,0,0,7,0,0,7,7,0,0,0,7,0,7,0,0,7,0,11,0,7,0,11,0,0,7,0,11,11,11,0,0,0,0,7,0,0,0,0,11,11,0,0,4,0,0,0,0,0,4,0,0,0,4,0,0,0}, {11,11,11,0,7,0,7,7,0,11,0,7,7,0,11,11,11,0,7,0,0,7,0,11,11,11,11,0,7,0,11,11,11,0,0,7,0,11,0,7,7,0,11,11,0,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,0,0,7,7,11,11,11,0,7,7,7,7,7,7,7,0,0,7,0,0,7,7,0,7,0,11,11,0,7,0,0,7,0,0,7,7,0,11,11,11,11,11,11,11,0,7,0,11,11,11,11,11,0,0,4,0,0,0,0,4,0,0,0,0,0,4,0,0}, {11,11,11,11,0,11,0,0,11,11,11,0,0,11,11,11,11,11,0,11,11,0,11,11,11,11,11,11,0,11,11,11,11,11,11,0,11,11,11,0,0,11,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,7,7,7,0,11,11,11,11,0,0,0,0,0,0,0,11,11,0,11,11,0,0,11,0,11,11,11,11,0,11,11,0,11,11,0,0,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,4,4,0,0,0,0,0,0,0,4,0}, {11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,7,7,7,7,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,0,0,7,7,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {11,11,11,11,0,11,11,11,0,11,0,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,11,11,11,11,11,11,11,0,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,7,7,0,7,7,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,11,0,0,0,0,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {11,11,11,0,7,0,11,0,7,0,7,0,11,11,11,11,11,11,0,7,0,11,0,0,0,0,7,7,0,11,11,11,11,11,0,7,0,11,11,0,0,7,0,0,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,7,7,7,0,7,11,11,11,11,11,11,0,7,0,0,0,11,11,0,7,7,7,7,7,0,7,7,7,7,0,11,11,0,7,0,0,0,7,0,0,0,11,0,0,0,0,7,0,0,0,0,11,11,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0}, {11,11,0,0,7,0,11,7,7,7,7,7,0,11,11,11,11,11,11,0,7,0,7,7,7,7,0,0,11,11,11,11,11,0,7,0,0,11,0,7,7,7,7,7,0,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,7,7,0,7,11,11,11,11,11,0,7,7,7,7,7,0,11,0,7,0,7,0,0,0,7,0,0,7,0,11,11,0,7,7,7,7,7,7,7,7,0,7,7,7,7,7,7,7,7,7,0,11,0,0,4,0,0,0,0,0,4,0,0,0,0,0,0,0}, {11,0,7,7,7,7,0,0,7,0,7,0,0,11,11,11,11,11,0,11,0,0,7,0,0,0,0,0,0,11,11,11,0,7,0,0,7,0,0,7,0,0,0,7,0,11,11,11,0,0,0,0,0,7,7,7,7,7,7,0,7,7,0,7,11,11,11,11,0,7,0,0,0,7,0,11,11,0,7,7,7,7,7,0,7,0,0,7,0,11,11,0,7,0,0,0,0,0,0,0,11,0,0,0,0,7,0,0,0,0,11,11,0,0,0,4,0,0,0,0,4,0,0,0,0,0,0,0}, {11,11,0,0,7,0,7,7,7,7,7,7,7,0,11,11,11,0,7,0,11,0,7,7,7,7,7,7,7,0,11,11,11,0,7,0,7,0,0,7,7,7,7,7,0,11,11,11,0,0,0,0,0,7,7,7,7,7,7,0,0,0,7,7,11,11,0,0,7,7,0,0,7,0,11,11,11,0,7,0,7,0,0,0,7,0,0,7,0,11,0,7,0,0,7,7,7,7,7,0,11,0,7,7,7,7,7,7,7,0,11,11,0,0,0,0,4,0,0,0,4,4,4,4,4,4,4,0}, {11,11,0,7,7,0,0,0,0,7,0,0,0,11,11,11,11,11,0,7,0,0,7,0,0,0,7,0,0,11,11,11,11,11,0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,11,0,7,0,7,7,0,0,7,0,7,7,7,0,11,11,11,0,0,0,0,0,7,7,7,7,0,0,0,7,7,0,0,11,11,0,0,7,7,7,7,7,7,7,0,0,11,0,7,7,0,7,0,7,0,7,0,11,11,0,7,0,0,7,7,7,7,7,0,11,0,0,0,0,7,0,0,0,0,11,11,0,0,0,4,0,0,0,0,0,4,0,4,0,0,0,0}, {11,11,11,0,7,11,0,7,7,7,7,7,0,11,11,11,11,11,0,7,0,11,0,7,0,0,7,0,11,11,11,11,0,7,0,7,7,0,0,7,0,7,0,7,0,11,11,11,0,0,0,0,0,7,0,7,7,0,0,7,7,7,7,0,11,11,11,0,7,0,0,0,0,0,7,0,11,0,7,7,0,0,7,0,7,0,0,7,0,11,0,7,0,11,0,0,7,0,0,11,0,7,7,7,7,7,7,7,7,7,0,11,0,0,0,4,0,0,0,0,0,4,0,4,0,0,0,0}, {11,11,11,0,7,0,0,0,7,0,7,0,0,11,11,11,11,0,7,0,11,0,7,0,11,11,0,7,0,11,11,11,0,7,0,7,0,0,7,0,0,7,0,0,7,0,11,11,0,0,0,0,0,0,0,7,7,0,0,0,0,0,7,7,11,11,11,0,7,0,0,0,0,0,7,0,0,7,7,0,0,0,7,0,7,0,0,7,0,11,0,7,0,11,0,0,7,0,11,11,11,0,0,0,0,7,0,0,0,0,11,11,0,0,4,0,0,0,0,0,4,0,0,0,4,0,0,0}, {11,11,11,0,7,0,7,7,0,11,0,7,7,0,11,11,11,0,7,0,0,7,0,11,11,11,11,0,7,0,11,11,11,0,0,7,0,11,0,7,7,0,11,11,0,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,0,0,7,7,11,11,11,0,7,7,7,7,7,7,7,0,0,7,0,0,7,7,0,7,0,11,11,0,7,0,0,7,0,0,7,7,0,11,11,11,11,11,11,11,0,7,0,11,11,11,11,11,0,0,4,0,0,0,0,4,0,0,0,0,0,4,0,0}, {11,11,11,11,0,11,0,0,11,11,11,0,0,11,11,11,11,11,0,11,11,0,11,11,11,11,11,11,0,11,11,11,11,11,11,0,11,11,11,0,0,11,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,0,0,7,7,7,0,11,11,11,11,0,0,0,0,0,0,0,11,11,0,11,11,0,0,11,0,11,11,11,11,0,11,11,0,11,11,0,0,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,0,0,0,0,0,4,4,0,0,0,0,0,0,0,4,0}, {11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,7,7,0,7,7,7,7,0,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }; //10 Yellow(Nambu Local) //11 Green (Yokohama Line) bool R1Data1[32]={0,1,0,0,1,0,1,1,0,1,1,1}; bool R1Data2[32]={0,1,0,0,1,0,1,1,0,1,1,0}; bool R1Data3[32]={0,1,0,0,1,0,1,1,0,1,1,0}; bool R1Data4[32]={0,1,0,0,1,0,1,1,0,1,0,0}; bool G1Data1[32]={0,0,1,0,1,1,0,1,1,0,1,1}; bool G1Data2[32]={0,0,1,0,1,1,0,1,1,0,1,1}; bool G1Data3[32]={0,0,1,0,1,1,0,1,0,0,0,0}; bool G1Data4[32]={0,0,1,0,1,1,0,1,0,0,0,0}; bool B1Data1[32]={0,0,0,1,0,1,1,1,1,1,0,0}; bool B1Data2[32]={0,0,0,1,0,1,1,1,1,0,0,0}; bool B1Data3[32]={0,0,0,1,0,1,1,1,1,0,0,0}; bool B1Data4[32]={0,0,0,1,0,1,1,1,1,0,0,0}; void Init() { // Set up things to a known state CLK = LOW; LAT = LOW; OE = HIGH; //display off ABC = 0; CT=0; } void WrRow(unsigned char Row, int Buffer[32][128]) { // Write specified row (and row+8) to display. Valid input: 0 to 7. ABC = 15-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 (Buffer [(15-Row)][col] == 0){ R1 = R_Debug1; G1 = G_Debug1; B1 = B_Debug1; }else { //R1 = R1Data1[(LEDBuffer [(7-Row)][col])]; //G1 = G1Data1[(LEDBuffer [(7-Row)][col])]; //B1 = B1Data1[(LEDBuffer [(7-Row)][col])]; R1 = R1Data1[(Buffer [(15-Row)][col])]; G1 = G1Data1[(Buffer [(15-Row)][col])]; B1 = B1Data1[(Buffer [(15-Row)][col])]; } if (Buffer [(31-Row)][col] == 0){ R2 = R_Debug1; G2 = G_Debug1; B2 = B_Debug1; }else { R2 = R1Data1[(Buffer [(31-Row)][col])]; G2 = G1Data1[(Buffer [(31-Row)][col])]; B2 = B1Data1[(Buffer [(31-Row)][col])]; } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock } LAT = HIGH; // Latch entire row LAT = LOW; } void WrRow2(unsigned char Row,int Buffer[32][128]) { // Write specified row (and row+8) to display. Valid input: 0 to 7. ABC = 15-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 (Buffer [(15-Row)][col] == 0){ R1 = R_Debug2; G1 = G_Debug2; B1 = B_Debug2; }else{ R1 = R1Data2[(Buffer [(15-Row)][col])]; G1 = G1Data2[(Buffer [(15-Row)][col])]; B1 = B1Data2[(Buffer [(15-Row)][col])]; } if (Buffer [(31-Row)][col] == 0){ R2 = R_Debug2; G2 = G_Debug2; B2 = B_Debug2; }else{ R2 = R1Data2[(Buffer [(31-Row)][col])]; G2 = G1Data2[(Buffer [(31-Row)][col])]; B2 = B1Data2[(Buffer [(31-Row)][col])]; } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock } LAT = HIGH; // Latch entire row LAT = LOW; } void WrRow3(unsigned char Row,int Buffer[32][128]) { // Write specified row (and row+8) to display. Valid input: 0 to 7. ABC = 15-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 (Buffer [(15-Row)][col] == 0){ R1 = R_Debug3; G1 = G_Debug3; B1 = B_Debug3; }else{ R1 = R1Data3[(Buffer [(15-Row)][col])]; G1 = G1Data3[(Buffer [(15-Row)][col])]; B1 = B1Data3[(Buffer [(15-Row)][col])]; } if (Buffer [(31-Row)][col] == 0){ R2 = R_Debug3; G2 = G_Debug3; B2 = B_Debug3; }else{ R2 = R1Data3[(Buffer [(31-Row)][col])]; G2 = G1Data3[(Buffer [(31-Row)][col])]; B2 = B1Data3[(Buffer [(31-Row)][col])]; } CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock } LAT = HIGH; // Latch entire row LAT = LOW; } void WrRow4(unsigned char Row,int Buffer[32][128]) { // Write specified row (and row+8) to display. Valid input: 0 to 7. ABC = 15-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 (Buffer [(15-Row)][col] == 0){ R1 = R_Debug4; G1 = G_Debug4; B1 = B_Debug4; }else{ R1 = R1Data4[(Buffer [(15-Row)][col])]; G1 = G1Data4[(Buffer [(15-Row)][col])]; B1 = B1Data4[(Buffer [(15-Row)][col])]; } if (Buffer [(31-Row)][col] == 0){ R2 = R_Debug4; G2 = G_Debug4; B2 = B_Debug4; }else{ R2 = R1Data4[(Buffer [(31-Row)][col])]; G2 = G1Data4[(Buffer [(31-Row)][col])]; B2 = B1Data4[(Buffer [(31-Row)][col])]; } 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. ABC = 15-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 = 0; // Red bit, upper half G1 = 0; // Green bit, upper half B1 = 0; // Blue bit, upper half R2 = 0; // Red bit, lower half G2 = 0; // Green bit, lower half B2 = 0; // Blue bit, lower half CLK = HIGH; // tick (clock bit in) CLK = LOW; // tock } LAT = HIGH; // Latch entire row LAT = LOW; } void Pset(unsigned char x,unsigned char y, unsigned char c) { // Set pixel (x,y) to color c // Manipulates graphics memory, so you won't see any change til you Paint() it. unsigned char ud,l,r0,g0,b0; ud=(y & 8)>>3; // 0 = upper half, 1 = lower half l=y & 7; // Extract row in upper/lower half r0=(c & 4) >>2; // Extract red bit from color g0=(c & 2) >>1; // Extract green bit from color b0=(c & 1); // Extract blue bit from color // *******Removes current bit ******* *Adds bit** gm[x][0+3*ud]=(gm[x][0+3*ud] & (255-(1<<(7-l))))+(r0<<(7-l)); // Red byte gm[x][1+3*ud]=(gm[x][1+3*ud] & (255-(1<<(7-l))))+(g0<<(7-l)); // Green byte gm[x][2+3*ud]=(gm[x][2+3*ud] & (255-(1<<(7-l))))+(b0<<(7-l)); // Blue byte } void Paint(int Buffer2[32][128]) { // Write graphics memory to display //1 for(int Row=0; Row<LED_Height; Row++) { OE = HIGH; // Disable output WrRow(Row,Buffer2); //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. } //2 for(int Row=0; Row<LED_Height; Row++) { OE = HIGH; // Disable output //WrRow(Row); WrRow2(Row,Buffer2); //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. } //3 for(int Row=0; Row<LED_Height; Row++) { OE = HIGH; // Disable output WrRow3(Row,Buffer2); //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. } //4 for(int Row=0; Row<LED_Height; Row++) { OE = HIGH; // Disable output WrRow4(Row,Buffer2); //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. } } void PaintOFF() { // Write graphics memory to display for(int Row=0; Row<8; Row++) { OE = HIGH; // Disable output WrRowOFF(Row); OE = LOW; // Enable output wait_us(50); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. } } void TimerTick(){ if (ChangeCount == 0){ ChangeCount = ChangeCount + 1; }else if(ChangeCount == 1 ){ ChangeCount = ChangeCount + 1; //ChangeCount = 0; }else if(ChangeCount == 2){ ChangeCount = 0; }else{ } } int main() { Init(); // Set things up ChangeTimer.attach(&TimerTick,5); while(1) { // Messy demo loop following... CT++; if (ChangeCount == 0){ Paint(LEDBuffer); }else if(ChangeCount == 1){ Paint(LEDBuffer2); }else if(ChangeCount == 2){ Paint(LEDBuffer3); } //if((CT<=2560)||(CT>=2880 && CT<=4160)) { // Paint(); // Refresh display // if((CT % 20)==0) ShiftRight(); // After every 20 refresh, do a ShiftRight //} //if(CT==2560) { // for(int c=0; c<8; c++) { // for(int x=c; x<(31-c); x++) {// Top side // Pset(x,c,c); // Paint(); // Display refresh time sets loop duration. // } // for(int y=c; y<(15-c); y++) {// Right side // Pset(31-c,y,c); // Paint(); // } // for(int x=(31-c); x>=c; x--) {// Bottom side // Pset(x,(15-c),c); // Paint(); // } // for(int y=(15-c); y>=c; y--) { // Left side // Pset(c,y,c); // Paint(); // } // } //} if(CT>4160) { //MkPattern(); // Restore original priceless artwork CT=0; // Start all over. } //PaintOFF(); //wait_us(10); } }