{ Servo control Timing : 80 clock ticks = 1 us. * * * * * Servo: Bij pulseVoltage = 3.3 V: pw=500 microsec => 0 graden pw=2420 microsec => 180 graden * * * * * } CON PER = 20000 '[microsec], corresponds to 50 Hz frequency of PW modulation, hence 20 millisec PPMS = 80 ' pulses per microsec ' PW0 and PW180 are the max pulsewidths the servo can handle. Use setmin and setmax in Start to set limits for your application PW0 = 500 PW180 = 2420 OBJ pwm : "pwmasmKKN" VAR word A_MAX word A_MIN PUB Start (pin,initangle, setmin, setmax) | pw A_MAX:=setmax A_MIN:=setmin if (initangle>A_MAX) initangle:=A_MAX if (initanglePW180) pw:=PW180 if (pwA_MAX) angle:=A_MAX if (anglePW180) pw:=PW180 if (pw