09-01-2014، 10:05 PM
کد پیاچپی:
$regfile = "m16def.dat"
$crystal = 800000
Config Pind.7 = Input
Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 8
Config Adc = Single , Prescaler = Auto , Reference = Off
Enable Adc
Start Adc
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
A:
Do
A = Getadc(0)
Pwm1a = A
Loop