09-01-2014، 10:02 PM
کد پیاچپی:
$regfile = "m16def.dat"
$crystal = 800000
Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 8
Dim A As Word
Dim B As Word
Config Portd = Output
Config Pinc.1 = Output
Config Pinc.0 = Output
Config Pinc.2 = Output
Config Pinc.3 = Output
Portc.0 = 1
Portc.1 = 0
Portc.2 = 1
Portc.3 = 0
A = 1
B = 65535
Pwm1b = B
Do
For A = 0 To 65535
Waitms 200
Pwm1a = A
Next A
Loop