Other news.
Changing the code from:
void i2cTransmit() {
//called by event
byte numBytes = 0;
switch (command) {
case 0x90:
numBytes = 4;
break;
}
if (numBytes > 0) {
Wire.write((byte*)txTable, numBytes);
}
}
to:
void i2cTransmit() {
//called by event
byte numBytes = 1;
Serial.println("Handle the command request from Master.");
/*
switch (command) {
case 0x90: //requested HSB
Serial.println("Master requested HSB.");
numBytes = 4;
break;
}
*/
if (numBytes > 0) {
Serial.print("Send num bytes: ");
Serial.println(numBytes);
//Wire.write((byte*)txTable, numBytes);
//Wire.write(txTable,4);
Wire.write(txTable[0]);
Wire.write(txTable[1]);
Wire.write(txTable[2]);
Wire.write(txTable[3]);
}
is working!
It remains only the why I can't use the "command" variable.