I noticed that your
setBoards function will call the
write function on your serial port twice for each Maestro board you are controlling. I would suggest refactoring your code that you only call
write once. Also, I would probably reorder the commands so that you first send all the speeds to your boards and then send all the targets. To do that, you would probably want to change your
setTargets functions to return some kind of list of bytes, and then you would concatenate those lists into a larger list in the proper order before you write it to the serial port.
A project with 98 servos sounds pretty interesting. Is there a website or video about the project?