arduino sketch to pan servo left and right

Try counting 90 as the centre (which it is) and sweeping from 90 to 180 and back then from 90 to 0 and back, a bit like the original sweep sketch does.

I suppose if you really insist on your original numbering you could always map -90 to 90 to 0 to 180...but I can't imagine why you would bother.

Steve