I've got a servo which requires a 50Hz signal (which can be achieved with a 20ms period) and a 1ms-2ms dutycycle. This is your standard hobby servo. 1ms dutycyle makes it go left (0 degrees) 1.5ms makes it go center (90 degrees) and 2ms makes it go right (180 degrees).
I'm also in the possession of a FTDI FT311D breakout board. With the android phone I got, I can command the FT311D to send the required PWM signal to the servo.
FTDI provides a java interface with which I can communicate with the FT311D. This interface defines a method SetDutyCycle(byte pwmChannel, byte dutyCycle).
As you can see the dutycycle is of type byte. The documentation says the following about this dutycycle byte:
dutyCycle: the percentage value of the duty cycle,e.g. to set 50% duty cycle, specify this value as 50. Minimum 5% and Maximum 95%.
My problem is this: I need 5% for the 1ms, I need 10% for the 2ms BUT i think I need 7.5 for the 1.5ms dutycycle, which I cannot assign to a single byte.
I might be missing something here. Or is this totally impossible? Maybe there are other possibilities?