Hi Rick and welcome to the forums!
That sounds a cool project :-) i would be curious to see some videos at the end of what you are trying to achieve, let me know if you end up sharing anything about it.
About your questions, all the information about Bonsai handling of the Firmata protocol is available on the bitbucket repository at:
Specifically you want to look at the following files:
- Arduino.cs
- ObservableArduino.cs
- ServoOutput.cs
These three form the backbone of the servo communication using Firmata. You can customize yourself the behavior of the protocol at multiple points. As far as I can see there is no explicit limitation of pin number on the Bonsai side, but indeed there may be in the Firmata protocol itself.
If your Firmata implementation can handle it, you can take control of the Arduino serial port itself and send custom sysex commands. For that you need to use a strategy similar to what is used in ObservableArduino.cs:
var connection = ArduinoManager.ReserveConnection(portName)
lock (connection.Arduino)
{
// command 0x76 (I2C) + slave_addr (LSB,MSB) + data0 (LSB, MSB) + data1(LSB,MSB) + ....
connection.Arduino.SendSysex(0x76, LSB, MSB, etc... see above);
}
It should be relatively easy to code up some custom Sink to get the arduino connection and send the needed sysex, if you are familiar with that level of the protocol.
Looking back, I think it makes sense to include some kind of I2C support in the next version of Bonsai, and I have taken a note to do so.
Current ETA end of January, early February, we'll see.
In any case, everything is there to make your own hackable version. Let me know if you would like me to explain anything in more detail.
Hope this helps.