Код с шимом:
- Код: Выделить всё
$regfile = "m16def.dat"
$crystal = 16000000
Config Timer1 = Pwm , Pwm = 8 , Prescale = 1 , Compare B Pwm = Clear Down
Config Pind.4 = Output
Dim S As Byte
Do
For S = 1 To 220 Step 10
Pwm1b = S
Incr S
Waitms 30
Next
For S = 220 To 1 Step -10
Pwm1b = S
Decr S
Waitms 30
Next
Loop