hi friends..i have 1 project wireless display board.
i use arduino mega and Adafruit RBG matrix led dispaly 32x64.
i follow wiring and example coding from Adafruit all work fine.
now i need modified this coding to make it wireless (i plan use Blnyk app and wifi). now i try modified this coding follow arduino example SerialDisplay, so i can sent any TEXT from serial monitor.
to many time try but not work
..
can anyone help check my coding?
here my coding:
// Similar to F(), but for PROGMEM string pointers rather than literals
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define OE 9
#define LAT 10
#define CLK 11
#define A A0
#define B A1
#define C A2
#define D A3
// Last parameter = 'true' enables double-buffering, for flicker-free,
// buttery smooth animation. Note that NOTHING WILL SHOW ON THE DISPLAY
// until the first call to swapBuffers(). This is normal.
RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, true, 64); //32X64
void setup() {
matrix.begin();
matrix.setTextWrap(false); // Allow text to run off right edge , false=LEFT TO RIGHT 1 LINE , TRUE=BOTTOM TO UP AND RUN TO RIGHT
matrix.setTextSize(3); // SIZE OF TEXT =1 SMALL , 2/3/4/5 BIG
Serial.begin(9600);
}
void loop() {
// byte i;
const char str[] PROGMEM = "HELLO";
const char str1[] PROGMEM = "";
int textX = matrix.width(),
textMin = sizeof(str) * -12, // CONTROL NO OF TEXT -12 = UNLIMITED
hue = 0;
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(1000);
// read all the available characters
while (Serial.available() > 0) {
matrix.fillScreen(0); // Clear background
// display each character to the LCD
// Draw big scrolly text on top
matrix.setTextColor(matrix.ColorHSV(hue, 255, 255, true)); // MULTICOLOR
//matrix.setTextColor(matrix.Color333(7,7,7)); //SINGLE COLOR
matrix.setCursor(textX, 1);
matrix.write(Serial.read()); // TEXT LINE 1
// Move text left (w/wrap), increase hue
if((--textX) < textMin) textX = matrix.width(); //textMin
hue += 7; // CONTROL COLOR CHANGE SPEED
if(hue >= 1536) hue -= 1536; //CONTROL COLOR CHANGE SPEED
// Update display
matrix.swapBuffers(false);
}
}
}