Hallo Leute!
Ich hab da ein kleines Problem:
Ich hab mir einen Ultraschallsensor mit Hilfe zweier Us-Kapseln zwei OP und nem Controller gebaut . Die Sache ist dieser aus den Artikeln sehr ähnlich.
http://www.roboternetz.de/phpBB2/zei...rag.php?t=3412
Dazu mal mein Code:
Code:$regfile = "m8def.dat" $crystal = 8000000 $baud = 19200 Adcsr = &B11101111 'free mode, prescale 128 interrupt enable Admux = &B01000000 'adlar =0 On Adc Onadc Dim Value(400) As Word Dim X As Word Dim A As Byte At &H60 Overlay Dim B As Byte At &H61 Overlay Dim C As Word At &H60 Overlay Print "Gleich geht es los:" Wait 2 Sound Portb.1 , 40 , 15 Enable Interrupts Enable Adc Do If X > 399 Then Disable Interrupts For X = 1 To 400 Print Value(x) 'end program Next End End If Loop Onadc: X = X + 1 B = Adch A = Adcl Value(x) = C Return
Lesezeichen