This is a little very simple code to produce the required servo pulse by reading an analog port (say a pot).
It then creates the pulse after some maths and loops back again.
IoannisCode:again: adcin channel,value 'read pot value if value>250 then value=250 'compress value over 250 pulse=4*value+1000 'upscale from 1000 to 2000 HIGH output_pin pauseus pulse 'create the servo pulse low output_pin pauseus (20000-pulse)' pause for the rest of the 20ms period goto again
Bookmarks