Hi kas, I got the Android Joystick Commander controlling pan’n’tilt servos connected to my ATmega1284 Arduino board this morning, pretty cool. The one thing I might suggest is providing a shorter Refresh Interval in the Advanced Options menu, eg as little as 20 or 40 msec if possible, then the servo responsiveness would be maximal.
I looked at your data protocol some more, and think it’s pretty good the way it is. You use 1-byte to send both control codes and data, so I wouldn’t worry about trying to send signed data. It’s easy enough to subtract off the offset = 60, once you know what the coding is.
Also, I think the resolution of +/-50 ultimately producing +/-500 usec servo pulse changes is ok, considering you’re doing the control manually by moving the on-screen joystick. After all, 10-usec is only 0.9 deg of servo movement.
All in all, nice job, :-).
My next task is learning how to write my own Android BT apps. BTW, can you tell me which tools you used?
EDIT: thinking of the coding a little more, you could actually scale it up to 120 +/-100 and get 2X the current servo movement resolution, and still have space left over at the low end for the various control codes. This would give 0.45 degree servo resolution, although it probably wouldn’t be noticeable when using the joystick. OTOH, you’d have an improved format that could also be used by other Android apps for control of the same Arduino h.w. systems, without having to change the latter’s code.
EDIT2: FYI, this afternoon, we loaded Joystick Commander into a friend’s Samsung Galaxy 3 cellphone running Android 4.1, and it worked perfectly in commanding my BT-Arduino1284 board and servos, so everything good. He was impressed, and not even an Arduino guy.