Hi,
I build a 3x3 LED Matrix to controll it from the iPad (or so) via HTML and PHP/Apache on the Serialport of a computer.
I send following 12 digit long string with help of the serial.class.php to the arduino board: xxRACA334455
First 2 char are to decide which method in the sketch should be used, digit 3 to 6 are a placeholder, since later I want to give each LED in my Matrix a seperate color, and the last 6 char are the color (as hex)
I have a method implemented to calculate the int-value from the Hexcode. Since Im stuck to windows I can't let the arduino reply the recieved data via Serial, and I can
T have the Serial Monitor from Arduino open, since that would block the communication of the PHP.
As I said, I send the String xxRACA334455 to the Arduino. With a seperate Port-Monitor I checked the COM Port and this String is really send, only the Arduino doesn't recieve it properly and changes the color sort of randomly.
When I am sending the same String per Arduinos SerialMonitor, it works quite fine and sets the proper color.
I know 12 char is quite a long command, but actually it should handel that, doesn't it? Are there any special circumstances I didn't know with php which I didn't took care of in my code?
Files are attached.
And here my schematic for the Matrix
It would be great if anyone could help me with this problem. Also apart from the Colorproblem, is the code for the LED-Powercontrolling ok?
serial.php (1.79 KB)
source_matrix.pde (9.09 KB)