Sending MATX shuts down board #21

Closed
opened 2018-11-11 18:59:47 +00:00 by Squatnet · 2 comments
Squatnet commented 2018-11-11 18:59:47 +00:00 (Migrated from github.com)

Sending MATX command only gets to Matrix A correctly, B (assume c also) will switch to pattern 0 (all off)

Sending MATX command only gets to Matrix A correctly, B (assume c also) will switch to pattern 0 (all off)
Squatnet commented 2018-11-11 19:01:17 +00:00 (Migrated from github.com)

The issue is in this function

void sendMatrix(){  //// Probably here that is issue ?? 
    String buff = string.substring(4);
    char buffer[buff.length()+1];
    buff.toCharArray(buffer, buff.length()+1);
    Wire.write(buffer);
    Wire.endTransmission();
    delay(500);
    digitalWrite(13,LOW);
    string = "";

The last line clears the string prematurely, Its fine if only sending to a single board but in the case of multiple sends the string is gone so we are sending just \0 to Boards B and C.

The issue is in this function ``` void sendMatrix(){ //// Probably here that is issue ?? String buff = string.substring(4); char buffer[buff.length()+1]; buff.toCharArray(buffer, buff.length()+1); Wire.write(buffer); Wire.endTransmission(); delay(500); digitalWrite(13,LOW); string = ""; ``` The last line clears the string prematurely, Its fine if only sending to a single board but in the case of multiple sends the string is gone so we are sending just ```\0``` to Boards B and C.
Squatnet commented 2018-11-11 19:37:19 +00:00 (Migrated from github.com)

Should also fix ALLX commands as is very likely the same bug.

Should also fix ALLX commands as is very likely the same bug.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
squatnet/ArduinoStuff#21
No description provided.