Hi, ich hab vor kurzem mein RN-Control Board (V1.4) bekommen und möchte nach ein paar LED tests einen LDR mittels ADC auswerten.
Doch auch mit der Suche und der RN-Wissensdatenbank bin ich nicht weitergekommen.
Meine Schaltung sieht folgendermaßen aus. Den LDR hab ich an einen der 3 VCC pins (JP1 Leiste) und an den 1. Stecker von Port 1 angeschlossen. (Ich hoffe soweit richtig)
Jetzt mein Source, der nicht funktioniert.
Gruß RobinCode:$regfile = "m32def.dat" $framesize = 32 $swstack = 32 $hwstack = 32 $crystal = 16000000 $baud = 9600 Config Portc.0 = Output Config Portc.1 = Output Config Portc.2 = Output Config Portc.3 = Output Config Portc.4 = Output Config Portc.5 = Output Config Portc.6 = Output Config Portc.7 = Output Config Porta = Input Config Adc = Single , Prescaler = Auto Dim W As Word , Ch As Long Dim Port As Long Tccr1b = Tccr1b Or &H02 Do Start Adc W = Getadc(ch) If W > 50 Then Portc.0 = 0 End If If W > 200 Then Portc.1 = 0 End If If W > 400 Then Portc.2 = 0 End If If W < 50 Then Portc.7 = 0 End If Ch = Ch + 1 If Ch > 7 Then Ch = 0 End If Waitms 100 Loop End
Lesezeichen