Serial data from visual basic. Help needed!

Hi all, I am very new to this and need a little help :( I have made a program that sends information through the serial port, this was done in visual basic. The numbers that are being sent vary from 0 to over 10000. I need to convert this to a servo position between 0 and 180. Any ideas? I was thinkin i should try and convert it in the visual basic program before sending it, although my vb programming is not very good.

Thanks in advance for any help

There is some code in the playground that receives serial data and writes it to a servo:

But that code expects values from 0 to 180 so you need to map the received values to this range.

You do that using the map function. Change: servo1.write(v); to servo1.write(map(v, 0,10000,0,180));

you can read more about map in the arduino reference.

Thanks for the help, I will be sure to check that out. Still waiting for my Arduino to come but I figured I would get started so long :)

Thanks again