Du hast auch keine Ahnung warum man GetAdc(4) nicht in ein Funktion packen lässt? Probier mir das mal bitte aus, ob das bei dir geht..

Also einmal im Hauptprogramm

portd.3 = 1
Print GetAdc(4)

Sollte eigentlich functionieren, und einmal

config pind.3 = output
portd.3 = 1

declare function pollswitch() as word

do
print pollswitch()
loop

function pollswitch() as word
pollswitch = getadc(4)
end function

Das funktioniert bei mit nämlich leider nicht ;-( wobei ich nicht weis wo da der Unterschied liegen soll...

Gruß, Sonic