@Zoomkat has some code to do that - Servo and Serial - #12 by zoomkat - Motors, Mechanics, Power and CNC - Arduino Forum