example:
program control motor servo ATMega 16 and BASCOM
$regfile = "m16def.dat"
$crystal = 11059200
$baud = 9600
Config Servos = 1 , Servo1 = Portb.0 , Reload = 10
Config Portb = Output
Enable Interrupts
'Servo(1) = 10 '10 times 10 = 100 uS on
'Servo(2) = 20 '20 times 10 = 200 uS on
Print "test"
Dim I As Byte
Do
Servo(1) = 170
Waitms 2000
Servo(1) = 100
Waitms 2000
Servo(1) = 30
Waitms 2000
Servo(1) = 100
Waitms 2000
'For I = 100 To 0 Step -1
'Servo(1) = 20
'Waitms 1000
'Next
Loop
End