Das verstehe ich dann leider auch nicht, hab leider gerade nix zum testen da...
Hier nochmla ein anderer Code:
Code:
$regfile = "m8def.dat"
$crystal = 8000000
$baud = 2400
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Admux = &B01100100
On Adc Onadc
Config Pind.3 = Output
Config Pinc.4 = Input
Config Pinc.0 = Input
Config Pinc.1 = Input
Portc.4 = 1
Portc.0 = 1
Portc.1 = 1
Portd.3 = 1
Dim Switch As Word
Dim Switsch As Word
Start Adc
Enable Interrupts
Enable Adc
Do
Switch = Getadc(4)
Print Switch
Switsch = Getadc(0)
Print Switsch
Waitms 100
Loop
End
Onadc:
If Getadc(4) < 1023 Then
Print "i"
End If
Print Getadc(4)
If Getadc(0) < 1023 Then
Print "i2"
End If
Print Getadc(0)
Return
Müsstest alles was du nicht brauchst streichen, der Code müsste aber laufen, meine ihn schon benutzt zu haben.
Lesezeichen