Code:
$regfile = "m8def.dat"
$crystal = 16000000
Dim Result As Word
Config Pinb.1 = Output
Config Pinb.2 = Output
Config Pinc.0 = Output
Config Pinc.1 = Output
Config Pinc.2 = Output
Config Pinc.3 = Output
Config Pinc.4 = Input
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up , Prescale = 1
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Compare1a = 1
Compare1b = 1
Portc.0 = 1
Portc.1 = 0
Portc.2 = 1
Portc.3 = 0
Start Adc
Do
Result = Getadc(4)
If
Result > 1000 Then
Portc.0 = 0
Portc.1 = 1
Portc.2 = 0
Portc.3 = 1
End if
Wait 1
Loop
End
Probier es mal so aus.
jon
Lesezeichen